Fix /home rendering

This commit is contained in:
soup 2024-11-16 16:17:26 -05:00
parent 920f162695
commit 54fa17ab25
2 changed files with 3 additions and 7 deletions

View file

@ -8,8 +8,7 @@ import (
"git.soup.land/soup/shelves/internal/templates/components"
)
type homeTemplate struct {
components.Page
type homeContent struct {
}
var homeTmpl = templates.MustParseEmbed("views/home.tmpl.html")
@ -20,6 +19,7 @@ func HomeGet(w http.ResponseWriter, req *http.Request) {
h := components.Page{
Title: "Home",
SessionInfo: ctx.SessionInfo,
Body: templates.HTML(homeTmpl, "body", homeContent{}),
}.HTML()
html(w, h)

View file

@ -1,6 +1,4 @@
{{define "Title"}}Home{{end}}
{{define "Body"}}
{{define "body"}}
<section>
<h1>Featured Shelves</h1>
</section>
@ -11,5 +9,3 @@
<h1>Recent Activity</h1>
</section>
{{end}}
{{template "page.tmpl.html" .}}