added title in each blog post page
arnaucode arnaucode@gmail.com
Sun, 31 Dec 2017 20:10:04 +0100
M
main.go
→
main.go
@@ -43,8 +43,11 @@ for _, post := range config.Posts {
mdcontent := readFile(directory + "/" + post.Md) htmlcontent := string(blackfriday.Run([]byte(mdcontent))) + firstline := strings.Split(mdcontent, "\n")[0] + title := strings.Replace(firstline, "# ", "", -1) + m := make(map[string]string) - m["[blogo-title]"] = config.Title + m["[blogo-title]"] = title + " - " + config.Title m["[blogo-content]"] = htmlcontent r := putHTMLToTemplate(indexTemplate, m)