Templates + build
This commit is contained in:
parent
67e2e4d306
commit
7e821296a6
13 changed files with 202 additions and 15 deletions
11
helpers/templates.go
Normal file
11
helpers/templates.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package helpers
|
||||
|
||||
import (
|
||||
"github.com/a-h/templ"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func TemplRender(c *fiber.Ctx, component templ.Component) error {
|
||||
c.Set("Content-Type", "text/html")
|
||||
return component.Render(c.UserContext(), c.Response().BodyWriter())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue