templates

package
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2016 License: AGPL-3.0, AGPL-3.0-or-later Imports: 7 Imported by: 0

Documentation

Overview

Package templates generates and stores HTML templates

Index

Constants

This section is empty.

Variables

View Source
var (
	// TemplateRoot stores the root directory of all HTML templates. Overridden
	// in tests.
	TemplateRoot = "templates"
)

Functions

func Compile

func Compile() error

Compile reads template HTML from disk, injects dynamic variables, hashes and stores them

func Set

func Set(name string, s Store)

Set sets a template to the specified value. Only use in tests.

Types

type Store

type Store struct {
	HTML []byte
	Hash string
}

Store stores the compiled HTML template and the corresponding truncated MD5 hash of said template

func Get

func Get(name string) Store

Get retrieves a compiled template by its name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL