diff --git a/hugolib/handler_file.go b/hugolib/handler_file.go index 32df80661..093fc686d 100644 --- a/hugolib/handler_file.go +++ b/hugolib/handler_file.go @@ -13,11 +13,23 @@ package hugolib -import "github.com/spf13/hugo/source" +import ( + "fmt" + _ "github.com/dchest/cssmin" + "github.com/spf13/hugo/source" +) -var Filer interface { - Read(*source.File) - Render() - Convert() - Extensions() []string +func init() { + RegisterHandler(css) +} + +var css = Handle{ + extensions: []string{"css"}, + read: func(f *source.File, s *Site, results HandleResults) { + results <- HandledResult{file: f} + }, + fileConvert: func(f *source.File, s *Site, results HandleResults) { + + fmt.Println(f.Path()) + }, } diff --git a/hugolib/handler_page.go b/hugolib/handler_page.go index dd30dc4d5..75bf91a23 100644 --- a/hugolib/handler_page.go +++ b/hugolib/handler_page.go @@ -15,11 +15,8 @@ package hugolib import "github.com/spf13/hugo/source" -var Pager interface { - Read(*source.File) - Render() - Convert() - Extensions() []string +func init() { + RegisterHandler(markdown) } var markdown = Handle{ @@ -49,7 +46,3 @@ var markdown = Handle{ results <- HandledResult{err: err} }, } - -func init() { - RegisterHandler(markdown) -} diff --git a/hugolib/handlers.go b/hugolib/handlers.go index d00a7497c..173cdfa5d 100644 --- a/hugolib/handlers.go +++ b/hugolib/handlers.go @@ -16,9 +16,14 @@ package hugolib import "github.com/spf13/hugo/source" type Handler interface { + // Read the Files in and register Read(*source.File, *Site, HandleResults) - //Render() + + // Convert Pages to prepare for templatizing + // Convert Files to their final destination Convert(interface{}, *Site, HandleResults) + + // Extensions to register the handle for Extensions() []string }