LoadHTMLFS loads an http.FileSystem and a slice of patterns and associates the result with HTML renderer.
(fs http.FileSystem, patterns ...string)
| 298 | // LoadHTMLFS loads an http.FileSystem and a slice of patterns |
| 299 | // and associates the result with HTML renderer. |
| 300 | func (engine *Engine) LoadHTMLFS(fs http.FileSystem, patterns ...string) { |
| 301 | if IsDebugging() { |
| 302 | engine.HTMLRender = render.HTMLDebug{FileSystem: fs, Patterns: patterns, FuncMap: engine.FuncMap, Delims: engine.delims} |
| 303 | return |
| 304 | } |
| 305 | |
| 306 | templ := template.Must(template.New("").Delims(engine.delims.Left, engine.delims.Right).Funcs(engine.FuncMap).ParseFS( |
| 307 | filesystem.FileSystem{FileSystem: fs}, patterns...)) |
| 308 | engine.SetHTMLTemplate(templ) |
| 309 | } |
| 310 | |
| 311 | // SetHTMLTemplate associate a template with HTML renderer. |
| 312 | func (engine *Engine) SetHTMLTemplate(templ *template.Template) { |