1

fix basic sample

This commit is contained in:
Alex Yatskov 2019-02-01 07:40:18 -08:00
parent 5377984d21
commit 32d3e56338
4 changed files with 9 additions and 10 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
dst build
cache

View File

@ -13,12 +13,12 @@ import (
type builder struct{} type builder struct{}
func (b *builder) Build(srcDir, dstDir string) { func (b *builder) Build(contentDir, buildDir, cacheDir string) {
errs := goldsmith.Begin(srcDir). errs := goldsmith.Begin(contentDir).
Chain(frontmatter.New()). Chain(frontmatter.New()).
Chain(markdown.New()). Chain(markdown.New()).
Chain(layout.New("layouts/*.html")). Chain(layout.New()).
End(dstDir) End(buildDir)
for _, err := range errs { for _, err := range errs {
log.Print(err) log.Print(err)
@ -26,10 +26,8 @@ func (b *builder) Build(srcDir, dstDir string) {
} }
func main() { func main() {
var ( port := flag.Int("port", 8080, "server port")
dst = flag.String("dst", "dst", "destination directory")
port = flag.Int("port", 8080, "server port")
)
flag.Parse() flag.Parse()
devserver.DevServe(new(builder), *port, "src", *dst, "layouts")
devserver.DevServe(new(builder), *port, "content", "build", "cache")
} }