From 501543d4b6d381a1de496baf2870993a03afcfdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 19 Jul 2018 17:47:05 +0200 Subject: [PATCH] hugolib: Only do page-relative getPage for relative paths Updates #4969 --- hugolib/page_collections.go | 6 ++---- 1 file 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