all repos — elgit @ d083d5d72e4bf496b8152d14986818a5b63fe301

fork of legit: web frontend for git, written in go

routes: serve static content from /static

commit

d083d5d72e4bf496b8152d14986818a5b63fe301

parent

b833d2f73d5f4e56d7e082495c44d394d2361cbd

1 file changed, 4 insertions(+), 4 deletions(-)

changed files
M routes/template.goroutes/template.go
@@ -13,7 +13,7 @@ "icyphox.sh/legit/git"
) 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) 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) 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 (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))