Browse Source

added links relative path

master
arnaucode 6 years ago
parent
commit
c523c0aba2
3 changed files with 2 additions and 1 deletions
  1. BIN
      blogo
  2. +1
    -1
      main.go
  3. +1
    -0
      readConfig.go

BIN
blogo


+ 1
- 1
main.go

@ -27,7 +27,7 @@ func main() {
m["[blogo-index-post-template]"] = htmlpostthumb
r := putHTMLToTemplate(indexPostTemplate, m)
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
}
//put the blogoIndex in the index.html

+ 1
- 0
readConfig.go

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

Loading…
Cancel
Save