Improve form and template usage (#66)

* Improve form and template usage.
This commit is contained in:
Mike Stefanello 2024-06-14 12:35:35 -04:00 committed by GitHub
parent 5f66b0ee71
commit 97bef0257e
22 changed files with 341 additions and 274 deletions

View file

@ -8,6 +8,7 @@ import (
"io/fs"
"sync"
"github.com/labstack/echo/v4"
"github.com/mikestefanello/pagoda/config"
"github.com/mikestefanello/pagoda/pkg/funcmap"
"github.com/mikestefanello/pagoda/templates"
@ -53,10 +54,10 @@ type (
)
// NewTemplateRenderer creates a new TemplateRenderer
func NewTemplateRenderer(cfg *config.Config) *TemplateRenderer {
func NewTemplateRenderer(cfg *config.Config, web *echo.Echo) *TemplateRenderer {
return &TemplateRenderer{
templateCache: sync.Map{},
funcMap: funcmap.GetFuncMap(),
funcMap: funcmap.NewFuncMap(web),
config: cfg,
}
}