Initial Handler Architecture WIP

This commit is contained in:
spf13
2014-10-17 16:57:48 -04:00
parent 20467e36b4
commit 8bd0ffba43
4 changed files with 97 additions and 0 deletions

View File

@@ -400,6 +400,14 @@ func (s *Site) CreatePages() error {
func sourceReader(s *Site, files <-chan *source.File, results chan<- pageResult, wg *sync.WaitGroup) {
defer wg.Done()
for file := range files {
// TODO: Switch here on extension
h := handlers.Handler(file.Extension())
if h != nil {
} else {
jww.ERROR.Println("Unsupported File Type", file.Path())
}
page, err := NewPage(file.Path())
if err != nil {
results <- pageResult{nil, err}