Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
Bundle represents a collection of templates that extend a shared base.
func NewBundle ¶
NewBundle creates a new bundle of templates with the given options.
The viewsDir is a glob pattern for templates considered to be primary pages (e.g., "views/*.html"). The sharedDirs are glob patterns for shared component templates.
func (*Bundle) HasTemplate ¶
HasTemplate checks if a template with the given name exists.
func (*Bundle) Render ¶
Render renders the named template with the given data to the http.ResponseWriter.
func (*Bundle) TemplateNames ¶
TemplateNames returns a list of all registered template names.
type Option ¶
Option is a functional option for configuring a Bundle.
func WithBaseTpl ¶
WithBaseTpl sets the base template name that other templates extend.