diff options
author | Pacien | 2013-06-30 19:38:24 +0200 |
---|---|---|
committer | Pacien | 2013-06-30 19:38:24 +0200 |
commit | 7b0b720efbf39ded2f72363d36424281df2b0491 (patch) | |
tree | ffa76bfb44820c7bf6e2b75cf667b355b08c8f8f /common.go | |
parent | 72b255dd4b0b182e3529a3cead0015e73be81680 (diff) | |
download | foldaweb-7b0b720efbf39ded2f72363d36424281df2b0491.tar.gz |
Add contextual methods
Diffstat (limited to 'common.go')
-rw-r--r-- | common.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -22,7 +22,7 @@ package main | |||
22 | import ( | 22 | import ( |
23 | "bytes" | 23 | "bytes" |
24 | "fmt" | 24 | "fmt" |
25 | "github.com/hoisie/mustache" | 25 | "github.com/drbawb/mustache" |
26 | "github.com/russross/blackfriday" | 26 | "github.com/russross/blackfriday" |
27 | "io/ioutil" | 27 | "io/ioutil" |
28 | "path" | 28 | "path" |
@@ -100,7 +100,7 @@ func compile(dirPath string, elements map[string][]byte, sourceDir, outputDir, s | |||
100 | } | 100 | } |
101 | 101 | ||
102 | template := merge(elements) | 102 | template := merge(elements) |
103 | page := mustache.Render(string(template), nil /* TODO: generate contextual variables */) | 103 | page := mustache.Render(string(template), makeContext(dirPath, sourceDir, outputDir, exts)) |
104 | 104 | ||
105 | err := writeFile(path.Join(outputDir, strings.TrimPrefix(dirPath, sourceDir), saveAs), []byte(page)) | 105 | err := writeFile(path.Join(outputDir, strings.TrimPrefix(dirPath, sourceDir), saveAs), []byte(page)) |
106 | if err != nil { | 106 | if err != nil { |