Documentation
¶
Overview ¶
Package ui provides HTML template rendering and cache version management for the application's user interface. It manages template initialization, cache busting, and page rendering functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeHash ¶
EscapeHash replaces all '#' characters with '%23' for use in safe URL query parameters. Exported for use in tests and template funcMap.
func GetCacheVersion ¶
func GetCacheVersion() string
GetCacheVersion returns the current cache version (thread-safe).
func ParseTemplates ¶
ParseTemplates parses all embedded HTML templates and the associated function map. It uses GetCacheVersion() for cache-busting in templates.
func RenderPage ¶
RenderPage renders a full HTML page by executing a named template within the base "layout" template. If partial is true, it renders only the "body" block for htmx partial updates.
func RenderTemplate ¶
RenderTemplate renders a single, standalone template by name. It is used for partials or components that are not part of a full page layout.
func SetCacheVersion ¶
func SetCacheVersion(version string)
SetCacheVersion updates the application-wide cache version. This should be called when config is loaded or updated.
Types ¶
This section is empty.