Documentation
¶
Overview ¶
Package templates provides tree-based template loading and rendering using HTML templates from the Go standard library.
Use Templates to obtain an acceptable.Processor loaded with the specified template files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultPage = "_index.html"
DefaultPage is the template name when a blank string is supplied. Alter this during startup if required.
var Fs = afero.NewOsFs()
Fs is used to obtain file information and content. It can be stubbed for testing.
var ReloadOnTheFly = false
ReloadOnTheFly enables a development mode that reloads template files whenever they change, without restarting the server. This reduces performance and should be off (false) for production.
Functions ¶
func ApplicationXhtmlOffer ¶
ApplicationXhtmlOffer is an Offer for application/xhtml+xml content using the Template() processor.
func Templates ¶
Templates finds all the templates in the directory dir and its subdirectories that have names ending with the given suffix (usually ".html").
Optionally, the suffix can be a pipe-separated list, e.g. ".html|.js".
The function map (see template.FuncMap) can be nil if not required.
A processor is returned that handles requests using the templates available.
Types ¶
This section is empty.