Closed ezynda3 closed 8 months ago
Right now I have a hacky workaround for anyone interested.
component := func(component string, props map[string]any) echo.HandlerFunc {
return func(c echo.Context) error {
golte.GetRenderContext(c.Request()).Components = nil
golte.RenderPage(c.Response().Writer, c.Request(), component, props)
return nil
}
}
Just realized there's no way to shed the template as well so you'll just end up returning the component wrapped with the original html template...
I've never used HTMX, but you can set the code inside the html template to this:
{{ .Head }}
{{ .Body }}
and that won't add any boilerplate HTML. Does this solve your use case?
Yes. Thanks!
I have a bit of an uncommon usecase but would love to be able to use this as my main templating system in conjunction with HTMX. As such it would be great to be able to render simple components without the need for a layout.