Fix paths

This commit is contained in:
Jan-Lukas Else 2020-11-17 17:43:30 +01:00
parent a1cf7ff71f
commit fc6c883eca
2 changed files with 10 additions and 3 deletions

View File

@ -252,9 +252,9 @@ func serveIndex(ic *indexConfig) func(w http.ResponseWriter, r *http.Request) {
"Posts": posts, "Posts": posts,
"HasPrev": hasPrev, "HasPrev": hasPrev,
"HasNext": hasNext, "HasNext": hasNext,
"First": appConfig.Server.PublicAddress + path, "First": slashIfEmpty(path),
"Prev": appConfig.Server.PublicAddress + prevPath, "Prev": slashIfEmpty(prevPath),
"Next": appConfig.Server.PublicAddress + nextPath, "Next": slashIfEmpty(nextPath),
"SummaryTemplate": summaryTemplate, "SummaryTemplate": summaryTemplate,
}, },
}) })

View File

@ -100,3 +100,10 @@ func resolveURLReferences(base string, refs ...string) ([]string, error) {
} }
return urls, nil return urls, nil
} }
func slashIfEmpty(s string) string {
if s == "" {
return "/"
}
return s
}