mirror of
https://git.mills.io/prologic/zs
synced 2024-11-28 16:26:11 +03:00
file, url and output should not be overridden by globals
This commit is contained in:
parent
70ba7396ff
commit
61600d0951
12
zs.go
12
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user