routes: add syntax highlight
1 file changed, 9 insertions(+), 2 deletions(-)
changed files
M routes/routes.go → routes/routes.go
@@ -225,6 +225,10 @@ return } contents, err := gr.FileContent(treePath) + if err != nil { + d.Write500(w) + return + } data := make(map[string]any) data["name"] = name data["displayname"] = getDisplayName(name)@@ -235,9 +239,12 @@ if raw { d.showRaw(contents, w) } else { - d.showFile(contents, data, w) + if d.c.Meta.SyntaxHighlight == "" { + d.showFile(contents, data, w) + } else { + d.showFileWithHighlight(treePath, contents, data, w) + } } - return } func (d *deps) Archive(w http.ResponseWriter, r *http.Request) {