LoadHTMLFiles loads a slice of HTML files and associates the result with HTML renderer.
(files ...string)
| 286 | // LoadHTMLFiles loads a slice of HTML files |
| 287 | // and associates the result with HTML renderer. |
| 288 | func (engine *Engine) LoadHTMLFiles(files ...string) { |
| 289 | if IsDebugging() { |
| 290 | engine.HTMLRender = render.HTMLDebug{Files: files, FuncMap: engine.FuncMap, Delims: engine.delims} |
| 291 | return |
| 292 | } |
| 293 | |
| 294 | templ := template.Must(template.New("").Delims(engine.delims.Left, engine.delims.Right).Funcs(engine.FuncMap).ParseFiles(files...)) |
| 295 | engine.SetHTMLTemplate(templ) |
| 296 | } |
| 297 | |
| 298 | // LoadHTMLFS loads an http.FileSystem and a slice of patterns |
| 299 | // and associates the result with HTML renderer. |