Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CtxConstructor ¶
type CtxConstructor struct {
Version string
JavascriptFiles []string
HBTemplates []HBTemplate
StaticData map[string]any
// contains filtered or unexported fields
}
func (*CtxConstructor) NewContext ¶
func (c *CtxConstructor) NewContext(ctx context.Context, data interface{}) *TemplateContext
type DataResolver ¶
TODO: wonder if this should operate on the *http.Request instead of just a context
type HBTemplate ¶
func (HBTemplate) ID ¶
func (t HBTemplate) ID() string
type LayerFS ¶
type LayerFS struct {
// contains filtered or unexported fields
}
func (*LayerFS) Filesystem ¶
type Manager ¶
type Manager struct {
Version string
RegistrationDisabled bool
StaticData map[string]any
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) Template ¶
func (m *Manager) Template(name string, opts ...TemplateOption) (*template.Template, *CtxConstructor, error)
maybe it would be better to change additionalTemplates to functional options, so more JS, CSS files, etc. but this will work for now until a need arises
type ManagerOption ¶
type ManagerOption func(*managerOptions)
func WithBaseHandlebarsTemplate ¶
func WithBaseHandlebarsTemplate(templates ...string) ManagerOption
func WithBaseJavascriptFiles ¶
func WithBaseJavascriptFiles(files ...string) ManagerOption
func WithBaseTemplates ¶
func WithBaseTemplates(templates ...string) ManagerOption
func WithDataResolver ¶
func WithDataResolver(name string, fn DataResolver) ManagerOption
type RemovePathElementFS ¶
type RemovePathElementFS struct {
// contains filtered or unexported fields
}
func NewRemovePathElementFS ¶
func NewRemovePathElementFS(element string, position int, base fs.FS) *RemovePathElementFS
type TemplateContext ¶
type TemplateOption ¶
type TemplateOption func(*templateOptions)
func WithAdditionalTemplates ¶
func WithAdditionalTemplates(templates ...string) TemplateOption
func WithHandlebarsTemplate ¶
func WithHandlebarsTemplate(templates ...string) TemplateOption
func WithJavascriptFiles ¶ added in v0.0.7
func WithJavascriptFiles(files ...string) TemplateOption
Click to show internal directories.
Click to hide internal directories.