Changeset 36 in code
- Timestamp:
- Sep 2, 2015, 5:41:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zs.go
r35 r36 112 112 v["layout"] = "layout.html" 113 113 } 114 title := strings.Replace(strings.Replace(path, "_", " ", -1), "-", " ", -1) 115 v["title"] = strings.ToTitle(title) 116 v["description"] = "" 114 117 v["file"] = path 115 118 v["url"] = path[:len(path)-len(filepath.Ext(path))] + ".html" … … 130 133 for key, value := range vars { 131 134 v[key] = value 132 log.Println(key, value)133 135 } 134 136 } … … 325 327 for { 326 328 os.Mkdir(PUBDIR, 0755) 327 err :=filepath.Walk(".", func(path string, info os.FileInfo, err error) error {329 filepath.Walk(".", func(path string, info os.FileInfo, err error) error { 328 330 // ignore hidden files and directories 329 331 if filepath.Base(path)[0] == '.' || strings.HasPrefix(path, ".") { … … 332 334 // inform user about fs walk errors, but continue iteration 333 335 if err != nil { 334 log.Println("ERROR:", err)336 fmt.Println("error:", err) 335 337 return nil 336 338 } … … 350 352 return nil 351 353 }) 352 if err != nil {353 log.Println("ERROR:", err)354 }355 354 if modified { 356 355 // At least one file in this build cycle has been modified
Note:
See TracChangeset
for help on using the changeset viewer.