Handler WIP

This commit is contained in:
spf13 2014-11-01 12:05:37 -04:00
parent 141f3e19e0
commit c5f1031e45
3 changed files with 26 additions and 16 deletions

View file

@ -13,11 +13,23 @@
package hugolib package hugolib
import "github.com/spf13/hugo/source" import (
"fmt"
_ "github.com/dchest/cssmin"
"github.com/spf13/hugo/source"
)
var Filer interface { func init() {
Read(*source.File) RegisterHandler(css)
Render() }
Convert()
Extensions() []string 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())
},
} }

View file

@ -15,11 +15,8 @@ package hugolib
import "github.com/spf13/hugo/source" import "github.com/spf13/hugo/source"
var Pager interface { func init() {
Read(*source.File) RegisterHandler(markdown)
Render()
Convert()
Extensions() []string
} }
var markdown = Handle{ var markdown = Handle{
@ -49,7 +46,3 @@ var markdown = Handle{
results <- HandledResult{err: err} results <- HandledResult{err: err}
}, },
} }
func init() {
RegisterHandler(markdown)
}

View file

@ -16,9 +16,14 @@ package hugolib
import "github.com/spf13/hugo/source" import "github.com/spf13/hugo/source"
type Handler interface { type Handler interface {
// Read the Files in and register
Read(*source.File, *Site, HandleResults) Read(*source.File, *Site, HandleResults)
//Render()
// Convert Pages to prepare for templatizing
// Convert Files to their final destination
Convert(interface{}, *Site, HandleResults) Convert(interface{}, *Site, HandleResults)
// Extensions to register the handle for
Extensions() []string Extensions() []string
} }