mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Small refactor: don't call p.Permalink()
for all aliases, call it only
once and only if necessary.
This commit is contained in:
parent
0bb3b49c00
commit
dcad066025
1 changed files with 9 additions and 4 deletions
|
@ -1060,11 +1060,16 @@ func (s *Site) possibleTaxonomies() (taxonomies []string) {
|
|||
// RenderAliases renders shell pages that simply have a redirect in the header
|
||||
func (s *Site) RenderAliases() error {
|
||||
for _, p := range s.Pages {
|
||||
if len(p.Aliases) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
plink, err := p.Permalink()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, a := range p.Aliases {
|
||||
plink, err := p.Permalink()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.WriteDestAlias(a, plink); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue