hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 501543d4b6d381a1de496baf2870993a03afcfdb
parent 6ffa8823495fcda3580748b2d1c84890af8914b9
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Thu, 19 Jul 2018 17:47:05 +0200

hugolib: Only do page-relative getPage for relative paths

Updates #4969

Diffstat:
Mhugolib/page_collections.go | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git 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