Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultTemplate ¶
GetDefaultTemplate returns the default template.
func SetTemplate ¶
SetTemplate reads in the template with the filename provided. If the file does not exist or is not parsable, it will return an error.
func Setup ¶
func Setup(c *caddy.Controller) error
setup configures a new Stencil middleware instance.
Types ¶
type CachedFileInfo ¶
type Config ¶
type Config struct { // Base path to match PathScope string // List of extensions to consider as stencil files Extensions map[string]struct{} // Template(s) to render with Template *template.Template // a pair of template's name and its underlying file information TemplateFiles map[string]*CachedFileInfo }
Config stores stencil middleware configurations.
type Data ¶
type Data struct { httpserver.Context Doc map[string]interface{} Files []FileInfo }
Data represents a stencil document.
type FileInfo ¶
FileInfo represents a file in a particular server context. It wraps the os.FileInfo struct.
type Stencil ¶
type Stencil struct { // Server root Root string // Jail the requests to site root with a mock file system FileSys http.FileSystem // Next HTTP handler in the chain Next httpserver.Handler // The list of stencil configurations Configs []*Config BufPool *sync.Pool }
Click to show internal directories.
Click to hide internal directories.