aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/renderer.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/frontend/renderer.go b/frontend/renderer.go
index eeff58e..d39dfe1 100644
--- a/frontend/renderer.go
+++ b/frontend/renderer.go
@@ -3,6 +3,9 @@ package frontend
3import ( 3import (
4 "html/template" 4 "html/template"
5 "net/http" 5 "net/http"
6 "os"
7 "path/filepath"
8 "strings"
6) 9)
7 10
8// Action ist die Aktion auf einer Card. 11// Action ist die Aktion auf einer Card.
@@ -70,8 +73,17 @@ func New(path string) *Renderer {
70 }, 73 },
71 } 74 }
72 75
76 files := make([]string, 0)
77 filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
78 if info.IsDir() || !strings.HasSuffix(path, ".html") {
79 return nil
80 }
81 files = append(files, path)
82 return nil
83 })
84
73 r := &Renderer{ 85 r := &Renderer{
74 template.Must(template.New("").Funcs(funcMap).ParseGlob(path + "/*")), 86 template.Must(template.New("").Funcs(funcMap).ParseFiles(files...)),
75 make(map[string]interface{}), 87 make(map[string]interface{}),
76 } 88 }
77 89