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")
if err = s.renderPages(); err != nil {
return
}
s.timerStep("render and write pages")
// Aliases must be rendered 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.
if err = s.renderAliases(); err != nil {
return
}
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 {
return
}