From cdb75d3fcbc9339b897f8c6ff4d69a577f017393 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Tue, 8 Jul 2025 23:26:05 +0100 Subject: Rewrite in Go --- web/command/handler/home.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 web/command/handler/home.go (limited to 'web/command/handler/home.go') diff --git a/web/command/handler/home.go b/web/command/handler/home.go new file mode 100644 index 0000000..a46d5ed --- /dev/null +++ b/web/command/handler/home.go @@ -0,0 +1,17 @@ +package handler + +import ( + "net/http" + + "github.com/LMBishop/scrapbook/pkg/config" + "github.com/LMBishop/scrapbook/pkg/index" + "github.com/LMBishop/scrapbook/web/command/html" + . "maragu.dev/gomponents" + ghttp "maragu.dev/gomponents/http" +) + +func GetHome(mainConfig *config.MainConfig, index *index.SiteIndex) func(http.ResponseWriter, *http.Request) { + return ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (Node, error) { + return html.HomePage(index), nil + }) +} -- cgit v1.2.3-70-g09d2