MCPcopy
hub / github.com/writefreely/writefreely / initPage

Function initPage

templates.go:86–103  ·  view source on GitHub ↗
(parentDir, path, key string)

Source from the content-addressed store, hash-verified

84}
85
86func 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
105func initUserPage(parentDir, path, key string) {
106 if debugging {

Callers 1

InitTemplatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected