Documentation ¶
Index ¶
- Variables
- func ExecuteTemplateToHTML(context interface{}, layouts ...string) template.HTML
- func Lookup(name string) *template.Template
- func ResetCaches()
- func SetI18nTfuncs(bndl *bundle.Bundle)
- func SetTranslateLang(language *helpers.Language) error
- type GoHTMLTemplate
- func (t *GoHTMLTemplate) AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error
- func (t *GoHTMLTemplate) AddInternalShortcode(name, content string) error
- func (t *GoHTMLTemplate) AddInternalTemplate(prefix, name, tpl string) error
- func (t *GoHTMLTemplate) AddTemplate(name, tpl string) error
- func (t *GoHTMLTemplate) AddTemplateFile(name, baseTemplatePath, path string) error
- func (t *GoHTMLTemplate) AddTemplateFileWithMaster(name, overlayFilename, masterFilename string) error
- func (t *GoHTMLTemplate) EmbedShortcodes()
- func (t *GoHTMLTemplate) EmbedTemplates()
- func (t *GoHTMLTemplate) GenerateTemplateNameFrom(base, path string) string
- func (t *GoHTMLTemplate) GetClone() *template.Template
- func (t *GoHTMLTemplate) LoadEmbedded()
- func (t *GoHTMLTemplate) LoadTemplates(absPath string)
- func (t *GoHTMLTemplate) LoadTemplatesWithPrefix(absPath string, prefix string)
- func (t *GoHTMLTemplate) Lookup(name string) *template.Template
- func (t *GoHTMLTemplate) MarkReady()
- func (t *GoHTMLTemplate) PrintErrors()
- type Template
- type Tmpl
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Logi18nWarnings set to true to print warnings about missing language strings Logi18nWarnings bool )
Functions ¶
func ExecuteTemplateToHTML ¶
func ResetCaches ¶
func ResetCaches()
ResetCaches resets all caches that might be used during build.
func SetI18nTfuncs ¶
SetI18nTfuncs sets the language bundle to be used for i18n.
func SetTranslateLang ¶
SetTranslateLang sets the translations language to use during template processing. This construction is unfortunate, but the template system is currently global.
Types ¶
type GoHTMLTemplate ¶
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) 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
Click to show internal directories.
Click to hide internal directories.