node to page: Render aliases before pages

Some sites, Hugo docs included, have faulty alias definitions that point
to itself or another real page. These will be overwritten in the next step.

This is how it behaves in Hugo 0.17, too.

Updates #2297
This commit is contained in:
Bjørn Erik Pedersen 2016-11-19 12:09:06 +01:00
parent 32fb1e6fac
commit 0bbdcf24fe

View file

@ -814,16 +814,20 @@ func (s *Site) render() (err error) {
} }
s.timerStep("prepare pages") s.timerStep("prepare pages")
if err = s.renderPages(); err != nil { // Aliases must be rendered before pages.
return // Some sites, Hugo docs included, have faulty alias definitions that point
} // to itself or another real page. These will be overwritten in the next
s.timerStep("render and write pages") // step.
if err = s.renderAliases(); err != nil { if err = s.renderAliases(); err != nil {
return return
} }
s.timerStep("render and write aliases") s.timerStep("render and write aliases")
if err = s.renderPages(); err != nil {
return
}
s.timerStep("render and write pages")
if err = s.renderSitemap(); err != nil { if err = s.renderSitemap(); err != nil {
return return
} }