Documentation
¶
Overview ¶
Helper for golang templates Helps to load templates from different directories and assets Based on https://github.com/unrolled/render
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delims ¶
type Delims struct {
// Left delimiter, defaults to {{.
Left string
// Right delimiter, defaults to }}.
Right string
}
Delims represents a set of Left and Right delimiters for HTML template rendering.
type Opts ¶
type Opts struct {
// Directory to load templates. Default is "extra/templates".
Directory string
// Asset function to use in place of directory. Defaults to nil.
Asset func(name string) ([]byte, error)
// AssetNames function to use in place of directory. Defaults to nil.
AssetNames func() []string
// Layout template name. Will not render a layout if blank (""). Defaults to blank ("").
Layout string
// Extensions to parse template files from. Defaults to [".html"].
Extensions []string
// Funcs is a slice of FuncMaps to apply to the template upon compilation. This is useful for helper functions. Defaults to [].
Funcs []template.FuncMap
// Delims sets the action delimiters to the specified strings in the Delims struct.
Delims Delims
// reload templates automatically
ReloadTemplates bool
}
type RenderOptions ¶
type RenderOptions struct {
// Layout template name. Overrides Options.Layout.
Layout string
}
RenderOptions is a struct for overriding some rendering Options for specific Render call.
Click to show internal directories.
Click to hide internal directories.