Documentation
¶
Overview ¶
Package web provides shared HTML template loading helpers used across services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseFuncMap ¶
BaseFuncMap returns the set of template functions that don't depend on any service-specific state (store, world, etc.). Services augment this map with their own helpers before calling MustParseTemplates.
Types ¶
type TemplateMap ¶
TemplateMap holds one isolated *template.Template per page file so that each page's {{define "content"}} / {{define "title"}} etc. don't collide.
func MustParseTemplates ¶
MustParseTemplates scans fsys/templates/, auto-detects partials (files that define no page-level blocks: title/sidebar/content/base), and builds one isolated *template.Template per page file. The caller provides funcs to merge into the FuncMap (typically from BaseFuncMap() plus service-specific helpers).
Optional extra FSes (e.g. chatux.FS) are treated as additional partials — all their templates/*.html files are parsed into every page template and __frags__, making their {{define}} blocks available everywhere.
The returned TemplateMap also contains a "__frags__" entry that holds all partials for HTMX partial responses.