diff options
Diffstat (limited to 'web/command/handler/home.go')
| -rw-r--r-- | web/command/handler/home.go | 17 |
1 files changed, 17 insertions, 0 deletions
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 + }) +} |
