Fix rebuild regression on non-default content language edits

Fixes #12043
This commit is contained in:
Bjørn Erik Pedersen
2024-02-16 14:24:35 +01:00
parent 43ea2cd660
commit 68f67c9aeb
4 changed files with 91 additions and 15 deletions

View File

@@ -17,6 +17,7 @@ import (
"context"
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/common/types"
"github.com/gohugoio/hugo/langs"
"github.com/gohugoio/hugo/media"
@@ -250,7 +251,10 @@ func IsStaleAny(os ...any) bool {
// MarkStale will mark any of the oses as stale, if possible.
func MarkStale(os ...any) {
for _, o := range os {
if s, ok := o.(Staler); ok {
if types.IsNil(o) {
continue
}
if s, ok := o.(StaleMarker); ok {
s.MarkStale()
}
}