} else {
v["layout"] = "layout.html"
}
+ title := strings.Replace(strings.Replace(path, "_", " ", -1), "-", " ", -1)
+ v["title"] = strings.ToTitle(title)
+ v["description"] = ""
v["file"] = path
v["url"] = path[:len(path)-len(filepath.Ext(path))] + ".html"
v["output"] = filepath.Join(PUBDIR, v["url"])
} else {
for key, value := range vars {
v[key] = value
- log.Println(key, value)
}
}
if strings.HasPrefix(v["url"], "./") {
vars := globals()
for {
os.Mkdir(PUBDIR, 0755)
- err := filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
+ filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
// ignore hidden files and directories
if filepath.Base(path)[0] == '.' || strings.HasPrefix(path, ".") {
return nil
}
// inform user about fs walk errors, but continue iteration
if err != nil {
- log.Println("ERROR:", err)
+ fmt.Println("error:", err)
return nil
}
}
return nil
})
- if err != nil {
- log.Println("ERROR:", err)
- }
if modified {
// At least one file in this build cycle has been modified
run(vars, "posthook")