mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-24 03:06:15 -06:00
[feature] Add page-specific class per template
This commit is contained in:
parent
a03a35a5d6
commit
8d37d1efcc
7 changed files with 12 additions and 6 deletions
|
|
@ -236,6 +236,14 @@ func templatePage(
|
|||
obj map[string]any,
|
||||
) {
|
||||
const pageTmpl = "page.tmpl"
|
||||
|
||||
// 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"
|
||||
|
||||
c.HTML(code, pageTmpl, obj)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue