1
goldsmith-samples/basic/main.go

30 lines
601 B
Go
Raw Normal View History

2016-11-02 02:37:42 +00:00
package main
import (
"log"
"github.com/FooSoft/goldsmith"
"github.com/FooSoft/goldsmith-devserver"
"github.com/FooSoft/goldsmith-plugins/frontmatter"
"github.com/FooSoft/goldsmith-plugins/layout"
"github.com/FooSoft/goldsmith-plugins/markdown"
)
type builder struct{}
func (b *builder) Build(srcDir, dstDir string) {
errs := goldsmith.Begin(srcDir).
Chain(frontmatter.New()).
2017-10-15 16:47:38 +00:00
Chain(markdown.New()).
2016-11-02 02:37:42 +00:00
Chain(layout.New("layouts/*.html")).
End(dstDir)
for _, err := range errs {
log.Print(err)
}
}
func main() {
devserver.DevServe(new(builder), 8080, "src", "dst", "layouts")
}