mirror of
https://github.com/gohugoio/hugo.git
synced 2024-07-04 08:11:55 +00:00
resources/page: Fix permalinks pattern detection for some of the sections variants
See #8363
This commit is contained in:
parent
048418ba74
commit
c13d368746
|
@ -51,10 +51,6 @@ func (p PermalinkExpander) callback(attr string) (pageToPermaAttribute, bool) {
|
||||||
return callback, true
|
return callback, true
|
||||||
}
|
}
|
||||||
|
|
||||||
if referenceTime.Format(attr) != attr {
|
|
||||||
return p.pageToPermalinkDate, true
|
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasPrefix(attr, "sections[") {
|
if strings.HasPrefix(attr, "sections[") {
|
||||||
fn := p.toSliceFunc(strings.TrimPrefix(attr, "sections"))
|
fn := p.toSliceFunc(strings.TrimPrefix(attr, "sections"))
|
||||||
return func(p Page, s string) (string, error) {
|
return func(p Page, s string) (string, error) {
|
||||||
|
@ -62,6 +58,11 @@ func (p PermalinkExpander) callback(attr string) (pageToPermaAttribute, bool) {
|
||||||
}, true
|
}, true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure this comes after all the other checks.
|
||||||
|
if referenceTime.Format(attr) != attr {
|
||||||
|
return p.pageToPermalinkDate, true
|
||||||
|
}
|
||||||
|
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue