coba landing page hanan

This commit is contained in:
Hanan Askarim
2024-04-29 14:45:12 +07:00
parent 99d7fd5159
commit 61788b3c85
8 changed files with 956 additions and 11 deletions

View File

@@ -0,0 +1,32 @@
package handlers
import (
"github.com/a-h/templ"
"github.com/emarifer/go-templ-project-structure/views/landingpage"
"github.com/labstack/echo/v4"
)
type LandingPageService interface {
}
func NewLandingPageHandler(us LandingPageService) *LandingPageHandler {
return &LandingPageHandler{
LandingPageService: us,
}
}
type LandingPageHandler struct {
LandingPageService LandingPageService
}
func (uh *LandingPageHandler) HendlerShowLandingPage(c echo.Context) error {
lp := landingpage.ShowLandingPage("Landing Page", landingpage.BodyLandingPage(), landingpage.CssLandingPage(), landingpage.JsLandingPage())
return uh.View(c, lp)
}
func (uh *LandingPageHandler) View(c echo.Context, cmp templ.Component) error {
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
return cmp.Render(c.Request().Context(), c.Response().Writer)
}

View File

@@ -15,6 +15,13 @@ func SetupRoutesXsample(app *echo.Echo, h *XsampleHandler) {
xSample := app.Group("/xsample")
xSample.GET("/xsample01", h.Hello)
}
//LANDINGPAGE TESTING
func SetupRoutesLandingPage(app *echo.Echo, h *LandingPageHandler) {
LandingPage := app.Group("/landingpage")
LandingPage.GET("/", h.HendlerShowLandingPage)
}
func SetupRoutesProject(app *echo.Echo) {
}