Skip to content

Commit 778f0d9

Browse files
committed
Don't re-render aliases on server rebuilds
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.
1 parent 13b208e commit 778f0d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hugolib/site.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ func (s *Site) render(ctx *siteRenderContext) (err error) {
15421542
return err
15431543
}
15441544

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

0 commit comments

Comments
 (0)