summaryrefslogtreecommitdiffstats
path: root/routes/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'routes/template.go')
-rw-r--r--routes/template.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routes/template.go b/routes/template.go
index 3d1e1cf..dc1ec35 100644
--- a/routes/template.go
+++ b/routes/template.go
@@ -13,7 +13,7 @@ import (
)
func (d *deps) Write404(w http.ResponseWriter) {
- tpath := filepath.Join(d.c.Template.Dir, "*")
+ tpath := filepath.Join(d.c.Dirs.Templates, "*")
t := template.Must(template.ParseGlob(tpath))
w.WriteHeader(404)
if err := t.ExecuteTemplate(w, "404", nil); err != nil {
@@ -22,7 +22,7 @@ func (d *deps) Write404(w http.ResponseWriter) {
}
func (d *deps) Write500(w http.ResponseWriter) {
- tpath := filepath.Join(d.c.Template.Dir, "*")
+ tpath := filepath.Join(d.c.Dirs.Templates, "*")
t := template.Must(template.ParseGlob(tpath))
w.WriteHeader(500)
if err := t.ExecuteTemplate(w, "500", nil); err != nil {
@@ -31,7 +31,7 @@ func (d *deps) Write500(w http.ResponseWriter) {
}
func (d *deps) listFiles(files []git.NiceTree, data map[string]any, w http.ResponseWriter) {
- tpath := filepath.Join(d.c.Template.Dir, "*")
+ tpath := filepath.Join(d.c.Dirs.Templates, "*")
t := template.Must(template.ParseGlob(tpath))
data["files"] = files
@@ -62,7 +62,7 @@ func countLines(r io.Reader) (int, error) {
}
func (d *deps) showFile(content string, data map[string]any, w http.ResponseWriter) {
- tpath := filepath.Join(d.c.Template.Dir, "*")
+ tpath := filepath.Join(d.c.Dirs.Templates, "*")
t := template.Must(template.ParseGlob(tpath))
lc, err := countLines(strings.NewReader(content))