diff options
author | Adam Mathes <adam@trenchant.org> | 2018-02-01 17:51:23 -0800 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2018-02-01 17:51:23 -0800 |
commit | 1dc63a221695eeacf226e301ec4306e8573e1b79 (patch) | |
tree | 6b58ac6e5594679b6030f526df3ae8da590dd205 /render | |
parent | 64afdffb9ec3e9fd7de1c802775b895c7681fac2 (diff) | |
download | snkt-1dc63a221695eeacf226e301ec4306e8573e1b79.tar.gz snkt-1dc63a221695eeacf226e301ec4306e8573e1b79.tar.bz2 snkt-1dc63a221695eeacf226e301ec4306e8573e1b79.zip |
list generic templates
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) |