mirror of
https://github.com/arnaucube/blogo.git
synced 2026-02-06 19:36:39 +01:00
added title in each blog post page
This commit is contained in:
@@ -90,3 +90,8 @@ Types of blogo tags:
|
||||
[blogo-content]
|
||||
[blogo-index-post-template]
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
Blogo is used in https://arnaucode.com/blog
|
||||
|
||||
5
main.go
5
main.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user