context

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncMap template.FuncMap = map[string]interface{}{}

FuncMap represents a set of functions, identified by some key, which will be availalbe to templates when rendering. Similarly to the context, the FuncMap will be passed through any time an ace template is rendered. See http://golang.org/pkg/text/template/#FuncMap. There is one func provided by default, called Posts, which is defined in compilers/posts_compiler.

Functions

func Add

func Add(key string, val interface{})

Add adds val to the context identified by key

Types

type Context

type Context map[string]interface{}

Context represents information that will be passed to each page when rendered. E.g. it allows you to render the title in a <title> tag inside of an ace template.

func CopyContext

func CopyContext() Context

Copy context returns a copy of the context. Modifying it will not change the original context. This function can be used to create a per-page or per-post context.

func GetContext

func GetContext() Context

GetContext returns the context

Jump to

Keyboard shortcuts

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