1
goldsmith-samples/basic/main.go
2018-01-08 09:24:26 -08:00

30 lines
645 B
Go

package main
import (
"log"
"github.com/FooSoft/goldsmith"
"github.com/FooSoft/goldsmith-components/devserver"
"github.com/FooSoft/goldsmith-components/plugins/frontmatter"
"github.com/FooSoft/goldsmith-components/plugins/layout"
"github.com/FooSoft/goldsmith-components/plugins/markdown"
)
type builder struct{}
func (b *builder) Build(srcDir, dstDir string) {
errs := goldsmith.Begin(srcDir).
Chain(frontmatter.New()).
Chain(markdown.New()).
Chain(layout.New("layouts/*.html")).
End(dstDir)
for _, err := range errs {
log.Print(err)
}
}
func main() {
devserver.DevServe(new(builder), 8080, "src", "dst", "layouts")
}