Next/Prev stuff

This commit is contained in:
Simon Martens
2025-03-30 18:12:52 +02:00
parent 316e8e3f58
commit 0e2c6360bf
25 changed files with 355 additions and 67 deletions

View File

@@ -188,6 +188,7 @@ func (e *Engine) AddFuncs(funcs template.FuncMap) {
}
func (e *Engine) Render(out io.Writer, path string, data any, layout ...string) error {
slog.Debug("Rendering template", "path", path, "layout", layout, "data", data)
e.mu.RLock()
ld := data.(map[string]any)
if e.GlobalData != nil {
@@ -195,6 +196,10 @@ func (e *Engine) Render(out io.Writer, path string, data any, layout ...string)
}
e.mu.RUnlock()
if e.debug {
slog.Debug("Rendering template", "path", path, "layout", layout, "data", ld)
}
e.regmu.RLock()
defer e.regmu.RUnlock()
var l *template.Template