Skip to content

Commit

Permalink
Don't re-render aliases on server rebuilds
Browse files Browse the repository at this point in the history
This can lead to stale aliases when rebuilding, but that's a trade-off we need to take for snappier rebuilds on bigger sites.

Note that it should be possible to detect alias changes, but I'm not sure it's worth it.
  • Loading branch information
bep committed Feb 1, 2025
1 parent 13b208e commit 778f0d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ func (s *Site) render(ctx *siteRenderContext) (err error) {
return err
}

if ctx.outIdx == 0 {
if ctx.outIdx == 0 && s.h.buildCounter.Load() == 0 {
// Note that even if disableAliases is set, the aliases themselves are
// preserved on page. The motivation with this is to be able to generate
// 301 redirects in a .htaccess file and similar using a custom output format.
Expand Down

0 comments on commit 778f0d9

Please sign in to comment.