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