Fix /home rendering
This commit is contained in:
parent
920f162695
commit
54fa17ab25
|
|
@ -8,8 +8,7 @@ import (
|
||||||
"git.soup.land/soup/shelves/internal/templates/components"
|
"git.soup.land/soup/shelves/internal/templates/components"
|
||||||
)
|
)
|
||||||
|
|
||||||
type homeTemplate struct {
|
type homeContent struct {
|
||||||
components.Page
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var homeTmpl = templates.MustParseEmbed("views/home.tmpl.html")
|
var homeTmpl = templates.MustParseEmbed("views/home.tmpl.html")
|
||||||
|
|
@ -20,6 +19,7 @@ func HomeGet(w http.ResponseWriter, req *http.Request) {
|
||||||
h := components.Page{
|
h := components.Page{
|
||||||
Title: "Home",
|
Title: "Home",
|
||||||
SessionInfo: ctx.SessionInfo,
|
SessionInfo: ctx.SessionInfo,
|
||||||
|
Body: templates.HTML(homeTmpl, "body", homeContent{}),
|
||||||
}.HTML()
|
}.HTML()
|
||||||
|
|
||||||
html(w, h)
|
html(w, h)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
{{define "Title"}}Home{{end}}
|
{{define "body"}}
|
||||||
|
|
||||||
{{define "Body"}}
|
|
||||||
<section>
|
<section>
|
||||||
<h1>Featured Shelves</h1>
|
<h1>Featured Shelves</h1>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -11,5 +9,3 @@
|
||||||
<h1>Recent Activity</h1>
|
<h1>Recent Activity</h1>
|
||||||
</section>
|
</section>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{template "page.tmpl.html" .}}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue