mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
parent
d57be11324
commit
ead5799f7e
4 changed files with 32 additions and 5 deletions
|
@ -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, "/")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue