arnaucube
arnaucube/blogoPublic Self-hosted repository
added title in each blog post page
arnaucode arnaucode@gmail.com
Sun, 31 Dec 2017 20:10:04 +0100
commit

6639024ed085f937f2ed4707f53641ba3b7d7e14

parent

c523c0aba2efa1bf0dc78b677940d70e2b37313e

3 files changed, 9 insertions(+), 1 deletions(-)

jump to
M README.md → README.md

@@ -90,3 +90,8 @@ [blogo-title]

[blogo-content] [blogo-index-post-template] ``` + + +--- + +Blogo is used in https://arnaucode.com/blog
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)