tpl

package
v0.0.0-...-206440e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2016 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTemplateToHTML

func ExecuteTemplateToHTML(context interface{}, layouts ...string) template.HTML

func Lookup

func Lookup(name string) *template.Template

Types

type GoHTMLTemplate

type GoHTMLTemplate struct {
	template.Template
	// contains filtered or unexported fields
}

func (*GoHTMLTemplate) AddAceTemplate

func (t *GoHTMLTemplate) AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error

func (*GoHTMLTemplate) AddInternalShortcode

func (t *GoHTMLTemplate) AddInternalShortcode(name, content string) error

func (*GoHTMLTemplate) AddInternalTemplate

func (t *GoHTMLTemplate) AddInternalTemplate(prefix, name, tpl string) error

func (*GoHTMLTemplate) AddTemplate

func (t *GoHTMLTemplate) AddTemplate(name, tpl string) error

func (*GoHTMLTemplate) AddTemplateFile

func (t *GoHTMLTemplate) AddTemplateFile(name, baseTemplatePath, path string) error

func (*GoHTMLTemplate) AddTemplateFileWithMaster

func (t *GoHTMLTemplate) AddTemplateFileWithMaster(name, overlayFilename, masterFilename string) error

func (*GoHTMLTemplate) EmbedShortcodes

func (t *GoHTMLTemplate) EmbedShortcodes()

func (*GoHTMLTemplate) EmbedTemplates

func (t *GoHTMLTemplate) EmbedTemplates()

func (*GoHTMLTemplate) GenerateTemplateNameFrom

func (t *GoHTMLTemplate) GenerateTemplateNameFrom(base, path string) string

func (*GoHTMLTemplate) GetClone

func (t *GoHTMLTemplate) GetClone() *template.Template

func (*GoHTMLTemplate) LoadEmbedded

func (t *GoHTMLTemplate) LoadEmbedded()

func (*GoHTMLTemplate) LoadTemplates

func (t *GoHTMLTemplate) LoadTemplates(absPath string)

func (*GoHTMLTemplate) LoadTemplatesWithPrefix

func (t *GoHTMLTemplate) LoadTemplatesWithPrefix(absPath string, prefix string)

func (*GoHTMLTemplate) Lookup

func (t *GoHTMLTemplate) Lookup(name string) *template.Template

func (*GoHTMLTemplate) MarkReady

func (t *GoHTMLTemplate) MarkReady()

MarkReady marks the template as "ready for execution". No changes allowed after this is set.

func (*GoHTMLTemplate) PrintErrors

func (t *GoHTMLTemplate) PrintErrors()

type Template

type Template interface {
	ExecuteTemplate(wr io.Writer, name string, data interface{}) error
	Lookup(name string) *template.Template
	Templates() []*template.Template
	New(name string) *template.Template
	GetClone() *template.Template
	LoadTemplates(absPath string)
	LoadTemplatesWithPrefix(absPath, prefix string)
	MarkReady()
	AddTemplate(name, tpl string) error
	AddTemplateFileWithMaster(name, overlayFilename, masterFilename string) error
	AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error
	AddInternalTemplate(prefix, name, tpl string) error
	AddInternalShortcode(name, tpl string) error
	PrintErrors()
}

TODO(bep) an interface with hundreds of methods ... remove it. And unexport most of these methods.

func InitializeT

func InitializeT() Template

InitializeT resets the internal template state to its initial state

func New

func New() Template

New returns a new Hugo Template System with all the additional features, templates & functions

func T

func T() Template

The "Global" Template System

type Tmpl

type Tmpl struct {
	Name string
	Data string
}

Jump to

Keyboard shortcuts

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