Changeset 37 in code
- Timestamp:
- Sep 2, 2015, 5:43:31 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zs.go
r36 r37 100 100 s := string(b) 101 101 102 // Copy globals first102 // Pick some default values for content-dependent variables 103 103 v := Vars{} 104 title := strings.Replace(strings.Replace(path, "_", " ", -1), "-", " ", -1) 105 v["title"] = strings.ToTitle(title) 106 v["description"] = "" 107 108 // Copy globals (will override title and description for markdown layouts 104 109 for name, value := range globals { 105 110 v[name] = value 106 111 } 107 112 108 // Override them bydefault values extracted from file name/path113 // Add default values extracted from file name/path 109 114 if _, err := os.Stat(filepath.Join(ZSDIR, "layout.amber")); err == nil { 110 115 v["layout"] = "layout.amber" … … 112 117 v["layout"] = "layout.html" 113 118 } 114 title := strings.Replace(strings.Replace(path, "_", " ", -1), "-", " ", -1)115 v["title"] = strings.ToTitle(title)116 v["description"] = ""117 119 v["file"] = path 118 120 v["url"] = path[:len(path)-len(filepath.Ext(path))] + ".html"
Note:
See TracChangeset
for help on using the changeset viewer.