1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

hugolib: Fix paginator URL for sections with URL in front matter

Fixes #4415
This commit is contained in:
Bjørn Erik Pedersen
2018-02-26 17:45:51 +01:00
parent e39797fa72
commit 9f740b37cf
2 changed files with 61 additions and 1 deletions

View File

@@ -208,11 +208,15 @@ func createTargetPath(d targetPathDescriptor) string {
} else {
pagePath = filepath.Join(pagePath, d.URL)
}
if d.Addends != "" {
pagePath = filepath.Join(pagePath, d.Addends)
} else if strings.HasSuffix(d.URL, "/") || !strings.Contains(d.URL, ".") {
}
if strings.HasSuffix(d.URL, "/") || !strings.Contains(d.URL, ".") {
pagePath = filepath.Join(pagePath, d.Type.BaseName+d.Type.MediaType.FullSuffix())
}
} else if d.Kind == KindPage {
if d.ExpandedPermalink != "" {
pagePath = filepath.Join(pagePath, d.ExpandedPermalink)