diff --git a/internal/api/util/template.go b/internal/api/util/template.go index d9db1f3c5..ec04a4d97 100644 --- a/internal/api/util/template.go +++ b/internal/api/util/template.go @@ -240,10 +240,12 @@ func templatePage( // Render given template inside the page. obj["pageContent"] = template - // Inject specific page class by replacing - // ".tmpl" with "-page", so "index.tmpl" for - // example gets class "page index-page". - obj["pageClass"] = template[0:len(template)-5] + "-page" + // Inject specific page class by trimming + // ".tmpl" suffix. In the page template + // (see page.tmpl) this will be appended + // with "-page", so "index.tmpl" for example + // ends up with class "page index-page". + obj["pageClass"] = template[:len(template)-5] c.HTML(code, pageTmpl, obj) } diff --git a/web/template/page.tmpl b/web/template/page.tmpl index e81c90aae..7dccc7469 100644 --- a/web/template/page.tmpl +++ b/web/template/page.tmpl @@ -71,7 +71,7 @@ image/webp {{- end }}