summaryrefslogtreecommitdiff
path: root/templ
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2024-10-16 22:18:06 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2024-10-16 22:18:06 +0200
commitca9d6a543335e998963ac4f680cf5c47e597602b (patch)
treecaaeb8009bc64e800bd1b4cbee592954e3f5b8f9 /templ
parentb20670125fede069a77e25d6414c3a5230e56f36 (diff)
downloadgosten-ca9d6a543335e998963ac4f680cf5c47e597602b.tar.gz
gosten-ca9d6a543335e998963ac4f680cf5c47e597602b.tar.bz2
gosten-ca9d6a543335e998963ac4f680cf5c47e597602b.zip
Inline form package
Diffstat (limited to 'templ')
-rw-r--r--templ/template.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/templ/template.go b/templ/template.go
index f609bc4..9cefadc 100644
--- a/templ/template.go
+++ b/templ/template.go
@@ -7,7 +7,7 @@ import (
"os"
"sync"
- "github.com/Necoro/form"
+ "gosten/form"
)
//go:embed *.tpl
@@ -17,7 +17,6 @@ var templates = make(map[string]*template.Template)
var muTpl sync.RWMutex
var baseTpl *template.Template
-var formBuilder form.Builder
var isLive = sync.OnceValue(checkLive)
@@ -31,10 +30,9 @@ func checkLive() bool {
func loadBase(fs fs.FS) {
baseTpl = template.Must(template.New("base.tpl").
- Funcs(form.FuncMap()).
+ Funcs(form.ParsingFuncMap()).
ParseFS(fs, "base.tpl", "form.tpl", "navlinks.tpl", "content.tpl"))
- formBuilder = form.Builder{InputTemplate: baseTpl.Lookup("formItem")}
- baseTpl.Funcs(formBuilder.FuncMap())
+ baseTpl.Funcs(form.FuncMap(baseTpl.Lookup("formItem")))
}
func Lookup(name string) *template.Template {