| 103 | } |
| 104 | |
| 105 | func initUserPage(parentDir, path, key string) { |
| 106 | if debugging { |
| 107 | log.Info(" [%s] %s", key, path) |
| 108 | } |
| 109 | |
| 110 | userPages[key] = template.Must(template.New(key).Funcs(funcMap).ParseFiles( |
| 111 | path, |
| 112 | filepath.Join(parentDir, templatesDir, "user", "include", "header.tmpl"), |
| 113 | filepath.Join(parentDir, templatesDir, "user", "include", "footer.tmpl"), |
| 114 | filepath.Join(parentDir, templatesDir, "user", "include", "silenced.tmpl"), |
| 115 | filepath.Join(parentDir, templatesDir, "user", "include", "nav.tmpl"), |
| 116 | )) |
| 117 | } |
| 118 | |
| 119 | // InitTemplates loads all template files from the configured parent dir. |
| 120 | func InitTemplates(cfg *config.Config) error { |