mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-19 07:02:51 +00:00
Rename ExtraData to more appropriate BodyAttributes
This commit is contained in:
parent
f3437d93c8
commit
e0f2868d34
@ -15,7 +15,7 @@
|
||||
<script src="/static/shortcuts.js"></script>
|
||||
{{range .HeadElements}}{{.}}{{end}}
|
||||
</head>
|
||||
<body data-rrh-addr="{{if .Addr}}{{.Addr}}{{else}}{{.Meta.Addr}}{{end}}"{{range .ExtraData}} data-rrh-{{.}}=""{{end}}>
|
||||
<body data-rrh-addr="{{if .Addr}}{{.Addr}}{{else}}{{.Meta.Addr}}{{end}}"{{range .BodyAttributes}} data-rrh-{{.}}=""{{end}}>
|
||||
<header>
|
||||
<nav class="main-width top-bar">
|
||||
<ul class="top-bar__wrapper">
|
||||
@ -61,4 +61,4 @@
|
||||
<script src="/static/view.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
@ -91,14 +91,14 @@ func localizedBaseWithWeirdBody(meta Meta) *template.Template {
|
||||
}
|
||||
|
||||
type BaseData struct {
|
||||
Meta Meta
|
||||
HeadElements []string
|
||||
HeaderLinks []HeaderLink
|
||||
CommonScripts []string
|
||||
Addr string
|
||||
Title string // TODO: remove
|
||||
Body string // TODO: remove
|
||||
ExtraData []string
|
||||
Meta Meta
|
||||
HeadElements []string
|
||||
HeaderLinks []HeaderLink
|
||||
CommonScripts []string
|
||||
Addr string
|
||||
Title string // TODO: remove
|
||||
Body string // TODO: remove
|
||||
BodyAttributes []string
|
||||
}
|
||||
|
||||
func (bd *BaseData) withBaseValues(meta Meta, headerLinks []HeaderLink, commonScripts []string) {
|
||||
@ -114,13 +114,13 @@ func Base(meta Meta, title, body string, extraData []string, headElements ...str
|
||||
meta.W = &w
|
||||
t := localizedBaseWithWeirdBody(meta)
|
||||
err := t.ExecuteTemplate(&w, "page", BaseData{
|
||||
Meta: meta,
|
||||
Title: title,
|
||||
HeadElements: headElements,
|
||||
HeaderLinks: HeaderLinks,
|
||||
CommonScripts: cfg.CommonScripts,
|
||||
Body: body,
|
||||
ExtraData: extraData,
|
||||
Meta: meta,
|
||||
Title: title,
|
||||
HeadElements: headElements,
|
||||
HeaderLinks: HeaderLinks,
|
||||
CommonScripts: cfg.CommonScripts,
|
||||
Body: body,
|
||||
BodyAttributes: extraData,
|
||||
})
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
Loading…
Reference in New Issue
Block a user