Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-19 18:47:05 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-19 18:47:05 +0300
commit501543d4b6d381a1de496baf2870993a03afcfdb (patch)
tree7d4a8a17d718843d490bdb34ee2c862bd0c43dff /hugolib
parent6ffa8823495fcda3580748b2d1c84890af8914b9 (diff)
hugolib: Only do page-relative getPage for relative paths
Updates #4969
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/page_collections.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/hugolib/page_collections.go b/hugolib/page_collections.go
index e364d2ef2..60f7dd83c 100644
--- a/hugolib/page_collections.go
+++ b/hugolib/page_collections.go
@@ -167,10 +167,8 @@ func (c *PageCollections) getPageNew(context *Page, ref string) (*Page, error) {
if p, err := c.getFromCache(ref); err == nil && p != nil {
return p, nil
}
- }
-
- // If there's a page context, try the page relative path.
- if context != nil {
+ } else if context != nil {
+ // Try the page-relative path.
ppath := path.Join("/", strings.Join(context.sections, "/"), ref)
if p, err := c.getFromCache(ppath); err == nil && p != nil {
return p, nil