From 32d3e5633817a86691d22be4c745a116a40623d6 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 1 Feb 2019 07:40:18 -0800 Subject: [PATCH] fix basic sample --- .gitignore | 3 ++- basic/{src => content}/index.md | 0 .../basic.html => content/layouts/basic.gohtml} | 0 basic/main.go | 16 +++++++--------- 4 files changed, 9 insertions(+), 10 deletions(-) rename basic/{src => content}/index.md (100%) rename basic/{layouts/basic.html => content/layouts/basic.gohtml} (100%) diff --git a/.gitignore b/.gitignore index c419571..ab307b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -dst +build +cache diff --git a/basic/src/index.md b/basic/content/index.md similarity index 100% rename from basic/src/index.md rename to basic/content/index.md diff --git a/basic/layouts/basic.html b/basic/content/layouts/basic.gohtml similarity index 100% rename from basic/layouts/basic.html rename to basic/content/layouts/basic.gohtml diff --git a/basic/main.go b/basic/main.go index 3188487..f1d02f2 100644 --- a/basic/main.go +++ b/basic/main.go @@ -13,12 +13,12 @@ import ( type builder struct{} -func (b *builder) Build(srcDir, dstDir string) { - errs := goldsmith.Begin(srcDir). +func (b *builder) Build(contentDir, buildDir, cacheDir string) { + errs := goldsmith.Begin(contentDir). Chain(frontmatter.New()). Chain(markdown.New()). - Chain(layout.New("layouts/*.html")). - End(dstDir) + Chain(layout.New()). + End(buildDir) for _, err := range errs { log.Print(err) @@ -26,10 +26,8 @@ func (b *builder) Build(srcDir, dstDir string) { } func main() { - var ( - dst = flag.String("dst", "dst", "destination directory") - port = flag.Int("port", 8080, "server port") - ) + port := flag.Int("port", 8080, "server port") flag.Parse() - devserver.DevServe(new(builder), *port, "src", *dst, "layouts") + + devserver.DevServe(new(builder), *port, "content", "build", "cache") }