Created a common.Page function that returns a function to render a page from a view.

This commit is contained in:
Zed A. Shaw 2025-07-26 22:43:59 -04:00
parent ec7298cce0
commit 1bd733c328

View file

@ -10,6 +10,12 @@ import (
"github.com/gofiber/template/html/v2" "github.com/gofiber/template/html/v2"
) )
func Page(path string) (func(c *fiber.Ctx) error) {
return func (c *fiber.Ctx) error {
return c.Render("stream", fiber.Map{})
}
}
func RenderPages(pages_path string, target string, layout string) { func RenderPages(pages_path string, target string, layout string) {
engine := html.New(pages_path, ".html") engine := html.New(pages_path, ".html")
engine.Load() engine.Load()