diff options
| author | horus_arch | 2015-08-29 17:57:54 +0200 |
|---|---|---|
| committer | horus_arch | 2015-08-29 17:57:54 +0200 |
| commit | 03d0a2f837d5b9b2072ca71301e8930fecf7e5b3 (patch) | |
| tree | e2d0395db46fe8e2e2ff07d24fb85f8c8ba7a71d /html.go | |
| download | tg-03d0a2f837d5b9b2072ca71301e8930fecf7e5b3.tar.gz | |
Diffstat (limited to 'html.go')
| -rw-r--r-- | html.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +package main + +import ( + "html/template" + "log" + "os" +) + +func ParseHTML(templates []string, data interface{}) { + // Parse the template dir + tmpl := template.Must(template.New("template").ParseGlob(*template_dir_f + "/*" + *ext_f)) + for _, template := range templates { + if template == "" { + continue + } + + err := tmpl.ExecuteTemplate(os.Stdout, template, data) + if err != nil { + log.Fatal(err) + } + } +} |
