hugo: github.com/gohugoio/hugo/tpl/partials Index | Files

package partials

import "github.com/gohugoio/hugo/tpl/partials"

Index

Package Files

init.go partials.go

Variables

var TestTemplateProvider deps.ResourceProvider

TestTemplateProvider is global deps.ResourceProvider. NOTE: It's currently unused.

type Namespace Uses

type Namespace struct {
    // contains filtered or unexported fields
}

Namespace provides template functions for the "templates" namespace.

func New Uses

func New(deps *deps.Deps) *Namespace

New returns a new instance of the templates-namespaced template functions.

func (*Namespace) Include Uses

func (ns *Namespace) Include(name string, contextList ...interface{}) (interface{}, error)

Include executes the named partial and returns either a string, when the partial is a text/template, or template.HTML when html/template.

func (*Namespace) IncludeCached Uses

func (ns *Namespace) IncludeCached(name string, context interface{}, variant ...string) (interface{}, error)

IncludeCached executes and caches partial templates. An optional variant string parameter (a string slice actually, but be only use a variadic argument to make it optional) can be passed so that a given partial can have multiple uses. The cache is created with name+variant as the key.

Package partials imports 8 packages (graph) and is imported by 6 packages. Updated 2017-11-20. Refresh now. Tools for package owners.