hugolib: Only do page-relative getPage for relative paths

Updates #4969
This commit is contained in:
Bjørn Erik Pedersen 2018-07-19 17:47:05 +02:00
parent 6ffa882349
commit 501543d4b6
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -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