Exemplo n.º 1
0
func GetTemplate(name string, t bundle.Template) *template.Template {
	if x := t.Lookup("shortcodes/" + name + ".html"); x != nil {
		return x
	}
	return t.Lookup("_internal/shortcodes/" + name + ".html")
}
Exemplo n.º 2
0
func ShortcodeRender(name string, data *ShortcodeWithPage, t bundle.Template) string {
	buffer := new(bytes.Buffer)
	t.ExecuteTemplate(buffer, "shortcodes/"+name+".html", data)
	return buffer.String()
}
Exemplo n.º 3
0
func GetTemplate(name string, t bundle.Template) *template.Template {
	return t.Lookup("shortcodes/" + name + ".html")
}