file, url and output should not be overridden by globals
git-svn-id: file:///srv/svn/repo/aya/trunk@30 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
12
zs.go
12
zs.go
@@ -35,22 +35,22 @@ func md(path string, globals Vars) (Vars, string, error) {
|
|||||||
s := string(b)
|
s := string(b)
|
||||||
url := path[:len(path)-len(filepath.Ext(path))] + ".html"
|
url := path[:len(path)-len(filepath.Ext(path))] + ".html"
|
||||||
v := Vars{
|
v := Vars{
|
||||||
"file": path,
|
|
||||||
"url": url,
|
|
||||||
"title": "",
|
"title": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"keywords": "",
|
"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 {
|
if _, err := os.Stat(filepath.Join(ZSDIR, "layout.amber")); err == nil {
|
||||||
v["layout"] = "layout.amber"
|
v["layout"] = "layout.amber"
|
||||||
} else {
|
} else {
|
||||||
v["layout"] = "layout.html"
|
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 {
|
if strings.Index(s, "\n\n") == -1 {
|
||||||
return v, s, nil
|
return v, s, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user