Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Custom ¶
func Custom(w http.ResponseWriter, status int, fn RenderFunc) error
Custom invokes a custom render function with status set.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine renders HTML templates.
func NewEngineFromFS ¶
NewEngineFromFS builds a template engine from an fs.FS.
func NewEngineWithOptions ¶
NewEngineWithOptions builds a template engine with options.
type Options ¶
type Options struct {
Layout string
Funcs FuncMap
Reload bool
// DevDir loads templates from disk when Reload is enabled (useful with embedded templates).
DevDir string
// IncludeSubdirs enables loading templates from nested directories.
IncludeSubdirs bool
// Partials lists glob patterns (relative to the templates dir) treated as partials.
Partials []string
}
Options configures the template engine.
type RenderFunc ¶
type RenderFunc func(http.ResponseWriter) error
RenderFunc allows custom rendering.
Click to show internal directories.
Click to hide internal directories.