]> Nishi Git Mirror - aya.git/commitdiff
file, url and output should not be overridden by globals
authorSerge A. Zaitsev <zaitsev.serge@gmail.com>
Sun, 30 Aug 2015 14:01:05 +0000 (16:01 +0200)
committerSerge A. Zaitsev <zaitsev.serge@gmail.com>
Sun, 30 Aug 2015 14:01:05 +0000 (16:01 +0200)
zs.go

diff --git a/zs.go b/zs.go
index a8d2c5a76ef12582575e53e71f8bc805da72c58a..a07bbdfa6ecf68d503cf89a2c948d65088d68f83 100644 (file)
--- a/zs.go
+++ b/zs.go
@@ -35,22 +35,22 @@ func md(path string, globals Vars) (Vars, string, error) {
        s := string(b)
        url := path[:len(path)-len(filepath.Ext(path))] + ".html"
        v := Vars{
-               "file":        path,
-               "url":         url,
                "title":       "",
                "description": "",
                "keywords":    "",
-               "output":      filepath.Join(PUBDIR, url),
+       }
+       for name, value := range globals {
+               v[name] = value
        }
        if _, err := os.Stat(filepath.Join(ZSDIR, "layout.amber")); err == nil {
                v["layout"] = "layout.amber"
        } else {
                v["layout"] = "layout.html"
        }
+       v["file"] = path
+       v["url"] = url
+       v["output"] = filepath.Join(PUBDIR, url)
 
-       for name, value := range globals {
-               v[name] = value
-       }
        if strings.Index(s, "\n\n") == -1 {
                return v, s, nil
        }