From 4de383fb85836a3329fcf4adc3169861208ce837 Mon Sep 17 00:00:00 2001 From: maddalax Date: Mon, 23 Sep 2024 12:09:03 -0500 Subject: [PATCH] remove --- htmgo-site/__htmgo/app.go | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 htmgo-site/__htmgo/app.go diff --git a/htmgo-site/__htmgo/app.go b/htmgo-site/__htmgo/app.go deleted file mode 100644 index 4e7f980..0000000 --- a/htmgo-site/__htmgo/app.go +++ /dev/null @@ -1,38 +0,0 @@ -package __htmgo - -import ( - "github.com/labstack/echo/v4" - "htmgo-site/pages" - "htmgo-site/partials" -) -import "github.com/maddalax/htmgo/framework/h" - -func RegisterPages(f *echo.Echo) { - f.GET("/docs", func(ctx echo.Context) error { - cc := ctx.(*h.RequestContext) - return h.HtmlView(ctx, pages.DocsPage(cc)) - }) - f.GET("/", func(ctx echo.Context) error { - cc := ctx.(*h.RequestContext) - return h.HtmlView(ctx, pages.IndexPage(cc)) - }) -} - -func GetPartialFromContext(ctx echo.Context) *h.Partial { - path := ctx.Request().URL.Path - if path == "ToggleNavbar" || path == "/htmgo-site/partials.ToggleNavbar" { - cc := ctx.(*h.RequestContext) - return partials.ToggleNavbar(cc) - } - return nil -} - -func RegisterPartials(f *echo.Echo) { - f.Any("htmgo-site/partials*", func(ctx echo.Context) error { - partial := GetPartialFromContext(ctx) - if partial == nil { - return ctx.NoContent(404) - } - return h.PartialView(ctx, partial) - }) -}