added title in each blog post page

This commit is contained in:
arnaucode
2017-12-31 20:10:04 +01:00
parent c523c0aba2
commit 6639024ed0
3 changed files with 9 additions and 1 deletions

View File

@@ -90,3 +90,8 @@ Types of blogo tags:
[blogo-content]
[blogo-index-post-template]
```
---
Blogo is used in https://arnaucode.com/blog

BIN
blogo

Binary file not shown.

View File

@@ -43,8 +43,11 @@ func main() {
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)