diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/render.go | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/render/render.go b/render/render.go index 1606305..ba8e52b 100644 --- a/render/render.go +++ b/render/render.go @@ -1,11 +1,11 @@ package render import ( - "bytes" "adammathes.com/snkt/config" + "adammathes.com/snkt/vlog" + "bytes" "io/ioutil" "log" - "adammathes.com/snkt/vlog" "os" "path" "path/filepath" @@ -27,6 +27,18 @@ type Renderable interface { Target() string } +func TemplateNames() []string { + templateNames := make([]string, len(templates)) + + i := 0 + for tName, _ := range templates { + templateNames[i] = tName + i++ + } + + return templateNames +} + func Write(a Renderable) { if config.Config.Verbose { vlog.Printf("Writing to %s\n", a.Target()) @@ -51,11 +63,10 @@ func Init() { tmplFuncs := template.FuncMap{ "ResolveURLs": ResolveURLs, - "SiteTitle": SiteTitle, - "SiteURL": SiteURL, + "SiteTitle": SiteTitle, + "SiteURL": SiteURL, } - base := path.Join(config.Config.TmplDir, BASE_TEMPLATE) for _, t := range ts { tf := filepath.Base(t) |