diff options
Diffstat (limited to 'gemini.go')
-rw-r--r-- | gemini.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -32,8 +32,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", runTemplate(tmpl, "diffstat.gmi", "text/plain")) - repoRouter.Route("/diff/:fromref/:toref", runTemplate(tmpl, "diff.gmi", "text/x-diff")) + repoRouter.Route("/diffstat/:fromref/:toref", runGemiTemplate(tmpl, "diffstat.gmi", "text/plain")) + repoRouter.Route("/diff/:fromref/:toref", runGemiTemplate(tmpl, "diff.gmi", "text/x-diff")) router := &sliderule.Router{} router.Route("/", geminiRoot(repodir, tmpl)) @@ -104,10 +104,10 @@ func geminiTreePath(tmpl *template.Template) sliderule.Handler { } func gmiTemplate(tmpl *template.Template, name string) sliderule.Handler { - return runTemplate(tmpl, name, "text/gemini; charset=utf-8") + return runGemiTemplate(tmpl, name, "text/gemini; charset=utf-8") } -func runTemplate(tmpl *template.Template, name, mimetype string) sliderule.Handler { +func runGemiTemplate(tmpl *template.Template, name, mimetype string) sliderule.Handler { return sliderule.HandlerFunc(func(ctx context.Context, request *sliderule.Request) *sliderule.Response { obj := map[string]any{ "Ctx": ctx, |