zedshaw.games/common/web.go
2025-11-03 14:09:57 -05:00

17 lines
359 B
Go

package common
import (
"strings"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/session"
)
var STORE *session.Store
func Page(path string) (func(c *fiber.Ctx) error) {
page_id := strings.ReplaceAll(path, "/", "-") + "-page"
return func (c *fiber.Ctx) error {
return c.Render(path, fiber.Map{"PageId": page_id})
}
}