// A template function which can include a partial template.
A template function which can include a partial template.
// A template function which can include a partial template .
func (mr *Renderer) Partial(name string, payload interface{}) (template.HTML, error) {
	var buff bytes.Buffer
	path := filepath.Join(mr.tplDir, "partials", name)
	tpl, loadErr := mr.acquireTemplate(path, path)
	if loadErr != nil {
		return "", loadErr
	}
	execErr := tpl.Execute(&buff, payload)
	if execErr != nil {
		return "", execErr
	}
	return template.HTML(string(buff.Bytes())), nil
}
func ( mr * Renderer ) Partial ( name string , payload interface { } ) ( template . HTML , error ) { var buff bytes . Buffer path := filepath . Join ( mr . tplDir , " " , name ) tpl , loadErr := mr . acquireTemplate ( path , path ) if loadErr != nil { return " " , loadErr } execErr := tpl . Execute ( & buff , payload ) if execErr != nil { return " " , execErr } return template . HTML ( string ( buff . Bytes ( ) ) ) , nil }
A template function which can include a partial template.
A template function which can include a partial template .