diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-09-23 13:10:27 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-09-23 13:10:27 -0600 |
commit | 32f84de36c9da1da47b718cb942afa36d1b23922 (patch) | |
tree | b2b57235f867ab33279a3f7d9987501461360681 /gemini.go | |
parent | d59ed1060d354ce911da1e7fb19f651feeafa2c1 (diff) |
use .gmi, .gmi.txt, .gph, .gph.txt everywhere for templates
Diffstat (limited to 'gemini.go')
-rw-r--r-- | gemini.go | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -34,15 +34,15 @@ const ( // The overrides argument can provide templates to define the behavior of nearly all of the above // routes. All of them have default implementations so the argument can even be nil, but otherwise // the template names used are: -// repo_root.gmi gemtext at / -// repo_home.gmi gemtext at /:repository/ -// branch_list.gmi gemtext at /:repository/branches -// tag_list.gmi gemtext at /:repository/tags -// ref.gmi gemtext at /:repository/refs/:ref/ -// tree.gmi gemtext for directories requested under /:repository/refs/:ref/tree/*path -// (file paths return the raw files without any template involved) -// diffstat.gmi the plaintext diffstat at /:repository/diffstat/:fromref/:toref -// diff.gmi the text/x-diff at /:repository/diff/:fromref/:toref +// repo_root.gmi gemtext at / +// repo_home.gmi gemtext at /:repository/ +// branch_list.gmi gemtext at /:repository/branches +// tag_list.gmi gemtext at /:repository/tags +// ref.gmi gemtext at /:repository/refs/:ref/ +// tree.gmi gemtext for directories requested under /:repository/refs/:ref/tree/*path +// (file paths return the raw files without any template involved) +// diffstat.gmi.txt the plaintext diffstat at /:repository/diffstat/:fromref/:toref +// diff.gmi.txt the text/x-diff at /:repository/diff/:fromref/:toref // // Most of the templates above are rendered with an object with 3 fields: // Ctx: the context.Context from the request @@ -63,8 +63,8 @@ func GeminiRouter(repodir string, overrides *template.Template) *sliderule.Route repoRouter.Route("/tags", gmiTemplate(tmpl, "tag_list.gmi")) repoRouter.Route("/refs/:ref/", gmiTemplate(tmpl, "ref.gmi")) repoRouter.Route("/refs/:ref/tree/*path", geminiTreePath(tmpl)) - repoRouter.Route("/diffstat/:fromref/:toref", runGemiTemplate(tmpl, "diffstat.gmi", "text/plain")) - repoRouter.Route("/diff/:fromref/:toref", runGemiTemplate(tmpl, "diff.gmi", "text/x-diff")) + repoRouter.Route("/diffstat/:fromref/:toref", runGemiTemplate(tmpl, "diffstat.gmi.txt", "text/plain")) + repoRouter.Route("/diff/:fromref/:toref", runGemiTemplate(tmpl, "diff.gmi.txt", "text/x-diff")) router := &sliderule.Router{} router.Route("/", geminiRoot(repodir, tmpl)) |