shithub: hugo

Download patch

ref: 501543d4b6d381a1de496baf2870993a03afcfdb
parent: 6ffa8823495fcda3580748b2d1c84890af8914b9
author: Bjørn Erik Pedersen <[email protected]>
date: Thu Jul 19 13:47:05 EDT 2018

hugolib: Only do page-relative getPage for relative paths

Updates #4969

--- a/hugolib/page_collections.go
+++ b/hugolib/page_collections.go
@@ -167,10 +167,8 @@
 		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