aboutsummaryrefslogtreecommitdiff
path: root/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'common.go')
-rw-r--r--common.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/common.go b/common.go
index 1a78017..9985aaa 100644
--- a/common.go
+++ b/common.go
@@ -98,10 +98,12 @@ func compile(dirPath string, elements map[string][]byte, sourceDir, outputDir, s
98 } 98 }
99 } 99 }
100 100
101 pagePath := strings.TrimPrefix(dirPath, sourceDir)
102
101 template := merge(elements) 103 template := merge(elements)
102 page := mustache.Render(string(template), makeContext(dirPath, sourceDir, outputDir, exts)) 104 page := mustache.Render(string(template), makeContext(pagePath, sourceDir, exts))
103 105
104 err := fcmd.WriteFile(path.Join(outputDir, strings.TrimPrefix(dirPath, sourceDir), saveAs), []byte(page)) 106 err := fcmd.WriteFile(path.Join(outputDir, pagePath, saveAs), []byte(page))
105 if err != nil { 107 if err != nil {
106 fmt.Println(err) 108 fmt.Println(err)
107 return 109 return