aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-11-13 16:57:29 (UTC)
committerjan <jan@ruken.pw>2016-11-13 16:57:29 (UTC)
commit3705a683482141481d6e4f1e563bc239fed05514 (patch)
treef7bcea8d7f9d4e2c64e36f5b171cffa0cfec5071 /frontend
parent0741b7c8b0e24de234b308c644c38cd94daf3b07 (diff)
fixieren von userangucken wenn man nicht eingeloggt ist
Diffstat (limited to 'frontend')
-rw-r--r--frontend/renderer.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend/renderer.go b/frontend/renderer.go
index 3fb79bf..d529dff 100644
--- a/frontend/renderer.go
+++ b/frontend/renderer.go
@@ -50,7 +50,7 @@ func (r *Renderer) SetDefaultData(data map[string]interface{}) {
50} 50}
51 51
52// New erstellt einen neuen Renderer und sucht alle Templates aus dem gegebenen pfad. 52// New erstellt einen neuen Renderer und sucht alle Templates aus dem gegebenen pfad.
53func New(path string) *Renderer { 53func New(path string, functions map[string]interface{}) *Renderer {
54 // Custom Template Funcs 54 // Custom Template Funcs
55 funcMap := template.FuncMap{ 55 funcMap := template.FuncMap{
56 "html": func(in string) template.HTML { 56 "html": func(in string) template.HTML {
@@ -73,6 +73,10 @@ func New(path string) *Renderer {
73 }, 73 },
74 } 74 }
75 75
76 for k, v := range functions {
77 funcMap[k] = v
78 }
79
76 files := make([]string, 0) 80 files := make([]string, 0)
77 filepath.Walk(path, func(path string, info os.FileInfo, err error) error { 81 filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
78 if info.IsDir() || !strings.HasSuffix(path, ".html") { 82 if info.IsDir() || !strings.HasSuffix(path, ".html") {