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 /dynamic.go | |
parent | 72b255dd4b0b182e3529a3cead0015e73be81680 (diff) | |
download | foldaweb-7b0b720efbf39ded2f72363d36424281df2b0491.tar.gz |
Add contextual methods
Diffstat (limited to 'dynamic.go')
-rw-r--r-- | dynamic.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -21,7 +21,7 @@ package main | |||
21 | 21 | ||
22 | import ( | 22 | import ( |
23 | "fmt" | 23 | "fmt" |
24 | "github.com/hoisie/mustache" | 24 | "github.com/drbawb/mustache" |
25 | "net/http" | 25 | "net/http" |
26 | "path" | 26 | "path" |
27 | "strings" | 27 | "strings" |
@@ -49,7 +49,7 @@ func handle(w http.ResponseWriter, r *http.Request) { | |||
49 | 49 | ||
50 | // render the page | 50 | // render the page |
51 | template := merge(elements) | 51 | template := merge(elements) |
52 | page := mustache.Render(string(template), nil /* TODO: generate contextual variables */) | 52 | page := mustache.Render(string(template), makeContext(path.Join(*settings.sourceDir, request), *settings.sourceDir, *settings.outputDir, settings.exts)) |
53 | 53 | ||
54 | // serve the page | 54 | // serve the page |
55 | _, err := w.Write([]byte(page)) | 55 | _, err := w.Write([]byte(page)) |