templates

package
v2.2.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 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. Overriden
	// 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