diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-01-30 11:43:20 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-01-30 20:12:19 +0100 |
commit | 5b7cb258ec26d7de690099f5dc39935b8d728155 (patch) | |
tree | 53544c8ab46e3fffda4a1e33c5d6e705183e2652 /config | |
parent | 80595bbe3e7901ecd6200e59d43af142c3c85b6b (diff) | |
download | hugo-5b7cb258ec26d7de690099f5dc39935b8d728155.tar.gz hugo-5b7cb258ec26d7de690099f5dc39935b8d728155.zip |
Create default link and image render hooks
Fixes #11933
Diffstat (limited to 'config')
-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: |