| 84 | } |
| 85 | |
| 86 | func initPage(parentDir, path, key string) { |
| 87 | if debugging { |
| 88 | log.Info(" [%s] %s", key, path) |
| 89 | } |
| 90 | |
| 91 | files := []string{ |
| 92 | path, |
| 93 | filepath.Join(parentDir, templatesDir, "include", "footer.tmpl"), |
| 94 | filepath.Join(parentDir, templatesDir, "base.tmpl"), |
| 95 | filepath.Join(parentDir, templatesDir, "user", "include", "silenced.tmpl"), |
| 96 | } |
| 97 | |
| 98 | if key == "login.tmpl" || key == "landing.tmpl" || key == "signup.tmpl" { |
| 99 | files = append(files, filepath.Join(parentDir, templatesDir, "include", "oauth.tmpl")) |
| 100 | } |
| 101 | |
| 102 | pages[key] = template.Must(template.New("").Funcs(funcMap).ParseFiles(files...)) |
| 103 | } |
| 104 | |
| 105 | func initUserPage(parentDir, path, key string) { |
| 106 | if debugging { |