From 4b58544300847e5faf19be5baa4eb177a86b2b0f Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Thu, 17 Jul 2025 21:52:26 +0100 Subject: Add automatic index --- web/command/html/home.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'web/command/html/home.go') diff --git a/web/command/html/home.go b/web/command/html/home.go index 5dc236a..6de30bd 100644 --- a/web/command/html/home.go +++ b/web/command/html/home.go @@ -5,16 +5,17 @@ import ( "github.com/LMBishop/scrapbook/pkg/index" "github.com/LMBishop/scrapbook/pkg/site" + . "github.com/LMBishop/scrapbook/web/skeleton" . "maragu.dev/gomponents" . "maragu.dev/gomponents/html" ) func HomePage(siteIndex *index.SiteIndex) Node { - return page("All sites", + return Page("All sites", H1(Text("All sites")), Div( - Class("sites-table"), + Class("table sites-table"), Group{ Span( Class("header name"), @@ -58,18 +59,18 @@ func HomePage(siteIndex *index.SiteIndex) Node { ), Span( Class("actions"), - navButton("Details", fmt.Sprintf("/site/%s/", site.Name)), + NavButton("Details", fmt.Sprintf("/site/%s/", site.Name)), ), } }), ), - If(len(siteIndex.GetSites()) == 0, alert("There are no sites to display", "")), + If(len(siteIndex.GetSites()) == 0, Alert("There are no sites to display", "")), Div( Class("control-group group-right"), - navButton("Create new", "/create"), + NavButton("Create new", "/create"), ), ) } -- cgit v1.2.3-70-g09d2