diff options
Diffstat (limited to 'config/allconfig/allconfig.go')
-rw-r--r-- | config/allconfig/allconfig.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go index 26e402305..742a28150 100644 --- a/config/allconfig/allconfig.go +++ b/config/allconfig/allconfig.go @@ -31,6 +31,7 @@ import ( "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/common/maps" "github.com/gohugoio/hugo/common/paths" + "github.com/gohugoio/hugo/common/types" "github.com/gohugoio/hugo/common/urls" "github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/config/privacy" @@ -899,6 +900,18 @@ func fromLoadConfigResult(fs afero.Fs, logger loggers.Logger, res config.LoadCon return nil, err } + // Adjust Goldmark config defaults for multilingual, single-host sites. + if len(languagesConfig) > 1 && !isMultiHost && !clone.Markup.Goldmark.DuplicateResourceFiles { + if !clone.Markup.Goldmark.DuplicateResourceFiles { + if clone.Markup.Goldmark.RenderHooks.Link.EnableDefault == nil { + clone.Markup.Goldmark.RenderHooks.Link.EnableDefault = types.NewBool(true) + } + if clone.Markup.Goldmark.RenderHooks.Image.EnableDefault == nil { + clone.Markup.Goldmark.RenderHooks.Image.EnableDefault = types.NewBool(true) + } + } + } + langConfigMap[k] = clone case maps.ParamsMergeStrategy: default: |