func RenderTemplateString(tmplString string, name string, out io.Writer, context interface{}) (err error) { var templ templatesystem.Template templ, err = Config.TemplateSystem.ParseString(tmplString, name) if err != nil { return } // context = append(context, Config) return templ.Render(out, context) }
func RenderTemplate(filename string, out io.Writer, context interface{}) (err error) { filePath, found, _ := FindTemplateFile(filename) if !found { return errs.Format("Template file not found: %s", filename) } var templ templatesystem.Template templ, err = Config.TemplateSystem.ParseFile(filePath) if err != nil { return } // context = append(context, Config) return templ.Render(out, context) }