mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Handler WIP
This commit is contained in:
parent
141f3e19e0
commit
c5f1031e45
3 changed files with 26 additions and 16 deletions
|
@ -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())
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue