mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
hugolib: Only do page-relative getPage for relative paths
Updates #4969
This commit is contained in:
parent
6ffa882349
commit
501543d4b6
1 changed files with 2 additions and 4 deletions
|
@ -167,10 +167,8 @@ func (c *PageCollections) getPageNew(context *Page, ref string) (*Page, error) {
|
||||||
if p, err := c.getFromCache(ref); err == nil && p != nil {
|
if p, err := c.getFromCache(ref); err == nil && p != nil {
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
}
|
} else if context != nil {
|
||||||
|
// Try the page-relative path.
|
||||||
// If there's a page context, try the page relative path.
|
|
||||||
if context != nil {
|
|
||||||
ppath := path.Join("/", strings.Join(context.sections, "/"), ref)
|
ppath := path.Join("/", strings.Join(context.sections, "/"), ref)
|
||||||
if p, err := c.getFromCache(ppath); err == nil && p != nil {
|
if p, err := c.getFromCache(ppath); err == nil && p != nil {
|
||||||
return p, nil
|
return p, nil
|
||||||
|
|
Loading…
Reference in a new issue