summaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_render.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r--hugolib/site_render.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go
index d9d60c2fa..7f5bcfb1a 100644
--- a/hugolib/site_render.go
+++ b/hugolib/site_render.go
@@ -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, "/")