diff --git a/hugo.toml b/hugo.toml index 0788d75d..69699a82 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1166,6 +1166,7 @@ enable = false c4u = false # Page config +# TODO migrate mapping key to `params` layer in the future [params.page] # FixIt 0.2.18 | NEW whether to enable the author's avatar of the post authorAvatar = true diff --git a/layouts/_markup/render-codeblock-json.html b/layouts/_markup/render-codeblock-json.html index 899a771b..e59b438b 100644 --- a/layouts/_markup/render-codeblock-json.html +++ b/layouts/_markup/render-codeblock-json.html @@ -1,4 +1,4 @@ -{{- $jsonViewer := .Attributes | merge (.Page.Param "jsonViewer") -}} +{{- $jsonViewer := .Attributes | merge .Page.Params.jsonViewer | merge .Page.Site.Params.jsonViewer -}} {{- if $jsonViewer.enable -}} {{- $attrs := printf `expand-depth="%v"` $jsonViewer.expanddepth -}} {{- $copyable := false -}} diff --git a/layouts/_partials/plugin/code-block-wrapper.html b/layouts/_partials/plugin/code-block-wrapper.html index 8a575867..06c5159c 100644 --- a/layouts/_partials/plugin/code-block-wrapper.html +++ b/layouts/_partials/plugin/code-block-wrapper.html @@ -1,5 +1,5 @@ {{- /* Hook for code blocks rendering */ -}} -{{- $config := .Attributes | merge (.Page.Param "codeblock") -}} +{{- $config := .Attributes | merge .Page.Params.codeblock | merge .Page.Site.Params.codeblock -}} {{- $result := transform.HighlightCodeBlock . -}} {{- $wrapper := $result.Wrapped -}} diff --git a/layouts/_shortcodes/version.html b/layouts/_shortcodes/version.html index f975d907..799e9933 100644 --- a/layouts/_shortcodes/version.html +++ b/layouts/_shortcodes/version.html @@ -1,4 +1,4 @@ -{{- $rvc := .Page.Param "repoVersion" -}} +{{- $rvc := .Page.Params.repoVersion | merge .Page.Site.Params.repoVersion -}} {{- $version := .Get 0 -}} {{- $type := .Get 1 | default "new" | lower -}} {{- $label := T (printf "version.%v" $type) | default (upper $type) -}}