Add PageHeader.BodyAttrs/SidebarAttrs escape hatches
Needed by yakwui's Alpine.js-based collapsible sidebar (x-data on <body>, :class binding on the sidebar <nav>) -- the shared markup has no generic opinion about a consumer's own client-side framework state.
This commit is contained in:
1 parent
671d9bd92d
commit
c99b000b1d
2 files changed
+10
-2
No files matched your search
@@ -58,6 +58,14 @@ type PageHeader struct {
|
||||
NavbarRightExtra template.HTML // extra markup rendered after Username/Logout in the navbar's right group
|
||||
ExtraHeadHTML template.HTML // extra <link>/<script> tags appended to <head>
|
||||
ExtraBodyHTML template.HTML // extra <script> tags appended before </body>
|
||||
// BodyAttrs/SidebarAttrs are raw extra attributes (include their own
|
||||
// leading space, e.g. ` x-data="{ open: true }"`) spliced into
|
||||
// <body...> and the sidebar's <nav...> tag -- an escape hatch for a
|
||||
// consuming project's own client-side framework state (e.g. yakwui's
|
||||
// Alpine.js collapsible sidebar), which the shared markup has no
|
||||
// generic opinion about.
|
||||
BodyAttrs template.HTML
|
||||
SidebarAttrs template.HTML
|
||||
}
|
||||
|
||||
// Renderer holds one independently parsed *template.Template per page:
|
||||
|
||||
Reference in new issue
Block a user