Changeset 30 in code


Ignore:
Timestamp:
Aug 30, 2015, 2:01:05 PM (10 years ago)
Author:
zaitsev.serge
Message:

file, url and output should not be overridden by globals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zs.go

    r29 r30  
    3636        url := path[:len(path)-len(filepath.Ext(path))] + ".html"
    3737        v := Vars{
    38                 "file":        path,
    39                 "url":         url,
    4038                "title":       "",
    4139                "description": "",
    4240                "keywords":    "",
    43                 "output":      filepath.Join(PUBDIR, url),
     41        }
     42        for name, value := range globals {
     43                v[name] = value
    4444        }
    4545        if _, err := os.Stat(filepath.Join(ZSDIR, "layout.amber")); err == nil {
     
    4848                v["layout"] = "layout.html"
    4949        }
    50 
    51         for name, value := range globals {
    52                 v[name] = value
    53         }
     50        v["file"] = path
     51        v["url"] = url
     52        v["output"] = filepath.Join(PUBDIR, url)
     53
    5454        if strings.Index(s, "\n\n") == -1 {
    5555                return v, s, nil
Note: See TracChangeset for help on using the changeset viewer.