Render aliases even if render=link

Fixes #7832
This commit is contained in:
Bjørn Erik Pedersen 2020-10-14 11:23:24 +02:00
parent d57be11324
commit ead5799f7e
4 changed files with 32 additions and 5 deletions

View file

@ -323,20 +323,28 @@ func (s *Site) renderRobotsTXT() error {
// renderAliases renders shell pages that simply have a redirect in the header.
func (s *Site) renderAliases() error {
var err error
s.pageMap.pageTrees.WalkRenderable(func(ss string, n *contentNode) bool {
s.pageMap.pageTrees.WalkLinkable(func(ss string, n *contentNode) bool {
p := n.p
if len(p.Aliases()) == 0 {
return false
}
pathSeen := make(map[string]bool)
for _, of := range p.OutputFormats() {
if !of.Format.IsHTML {
return false
continue
}
plink := of.Permalink()
f := of.Format
if pathSeen[f.Path] {
continue
}
pathSeen[f.Path] = true
plink := of.Permalink()
for _, a := range p.Aliases() {
isRelative := !strings.HasPrefix(a, "/")