added links relative path

This commit is contained in:
arnaucode
2017-12-30 09:00:32 +01:00
parent 5ad6c1f875
commit c523c0aba2
3 changed files with 2 additions and 1 deletions

BIN
blogo

Binary file not shown.

View File

@@ -27,7 +27,7 @@ func main() {
m["[blogo-index-post-template]"] = htmlpostthumb m["[blogo-index-post-template]"] = htmlpostthumb
r := putHTMLToTemplate(indexPostTemplate, m) r := putHTMLToTemplate(indexPostTemplate, m)
filename := strings.Split(post.Md, ".")[0] filename := strings.Split(post.Md, ".")[0]
r = "<a href='" + filename + ".html'>" + r + "</a>" r = "<a href='" + config.RelativePath + "/" + filename + ".html'>" + r + "</a>"
blogoIndex = blogoIndex + r blogoIndex = blogoIndex + r
} }
//put the blogoIndex in the index.html //put the blogoIndex in the index.html

View File

@@ -14,6 +14,7 @@ type Post struct {
//Config gets the config.json file into struct //Config gets the config.json file into struct
type Config struct { type Config struct {
Title string `json:"title"` Title string `json:"title"`
RelativePath string `json:"relativePath"`
IndexTemplate string `json:"indexTemplate"` IndexTemplate string `json:"indexTemplate"`
PostThumbTemplate string `json:"postThumbTemplate"` PostThumbTemplate string `json:"postThumbTemplate"`
Posts []Post `json:"posts"` Posts []Post `json:"posts"`