summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/config.toml2
-rw-r--r--docs/content/en/getting-started/configuration.md20
-rw-r--r--docs/data/docs.json59
-rw-r--r--docs/layouts/shortcodes/code-toggle.html59
4 files changed, 113 insertions, 27 deletions
diff --git a/docs/config.toml b/docs/config.toml
index efa1b0573..d21f6f172 100644
--- a/docs/config.toml
+++ b/docs/config.toml
@@ -7,7 +7,7 @@ footnotereturnlinkcontents = "↩"
languageCode = "en-us"
title = "Hugo"
- ignoreErrors = ["error-remote-getjson"]
+ ignoreErrors = ["error-remote-getjson", "err-missing-instagram-accesstoken"]
googleAnalytics = "UA-7131036-4"
diff --git a/docs/content/en/getting-started/configuration.md b/docs/content/en/getting-started/configuration.md
index 48a4af0c9..fd8c65d04 100644
--- a/docs/content/en/getting-started/configuration.md
+++ b/docs/content/en/getting-started/configuration.md
@@ -80,6 +80,26 @@ Considering the structure above, when running `hugo --environment staging`, Hugo
{{% note %}}
Default environments are __development__ with `hugo server` and __production__ with `hugo`.
{{%/ note %}}
+
+## Merge Configuration from Themes
+
+{{< new-in "0.84.0" >}} The configuration merge described below was improved in Hugo 0.84.0 and made fully configurable. The big change/improvement was that we now, by default, do deep merging of `params` maps from themes.
+
+The configuration value for `_merge` can be one of:
+
+none
+: No merge.
+
+shallow
+: Only add values for new keys.
+
+shallow
+: Add values for new keys, merge existing.
+
+Note that you don't need to be so verbose as in the default setup below; a `_merge` value higher up will be inherited if not set.
+
+{{< code-toggle config="mergeStrategy" skipHeader=true />}}
+
## All Configuration Settings
The following is the full list of Hugo-defined variables with their default
diff --git a/docs/data/docs.json b/docs/data/docs.json
index 2b17ad8af..b927f8d0a 100644
--- a/docs/data/docs.json
+++ b/docs/data/docs.json
@@ -1587,6 +1587,65 @@
"preserveTOC": false
}
},
+ "mergeStrategy": {
+ "build": {
+ "_merge": "none"
+ },
+ "caches": {
+ "_merge": "none"
+ },
+ "frontmatter": {
+ "_merge": "none"
+ },
+ "imaging": {
+ "_merge": "none"
+ },
+ "languages": {
+ "_merge": "none",
+ "en": {
+ "_merge": "none",
+ "menus": {
+ "_merge": "shallow"
+ },
+ "params": {
+ "_merge": "deep"
+ }
+ }
+ },
+ "markup": {
+ "_merge": "none"
+ },
+ "mediatypes": {
+ "_merge": "shallow"
+ },
+ "menus": {
+ "_merge": "shallow"
+ },
+ "minify": {
+ "_merge": "none"
+ },
+ "module": {
+ "_merge": "none"
+ },
+ "outputformats": {
+ "_merge": "shallow"
+ },
+ "params": {
+ "_merge": "deep"
+ },
+ "permalinks": {
+ "_merge": "none"
+ },
+ "related": {
+ "_merge": "none"
+ },
+ "sitemap": {
+ "_merge": "none"
+ },
+ "taxonomies": {
+ "_merge": "none"
+ }
+ },
"minify": {
"minifyOutput": false,
"disableHTML": false,
diff --git a/docs/layouts/shortcodes/code-toggle.html b/docs/layouts/shortcodes/code-toggle.html
index da4b00719..0b92d520d 100644
--- a/docs/layouts/shortcodes/code-toggle.html
+++ b/docs/layouts/shortcodes/code-toggle.html
@@ -1,34 +1,41 @@
{{ $file := .Get "file" }}
{{ $code := "" }}
{{ with .Get "config" }}
-{{ $file = $file | default "config" }}
-{{ $sections := (split . ".") }}
-{{ $configSection := index $.Site.Data.docs.config $sections }}
-{{ $code = dict $sections $configSection }}
+ {{ $file = $file | default "config" }}
+ {{ $sections := (split . ".") }}
+ {{ $configSection := index $.Site.Data.docs.config $sections }}
+ {{ $code = dict $sections $configSection }}
+ {{ if $.Get "skipHeader"}}
+ {{ $code = $configSection }}
+ {{ end }}
{{ else }}
-{{ $code = $.Inner }}
+ {{ $code = $.Inner }}
{{ end }}
{{ $langs := (slice "yaml" "toml" "json") }}
<div class="code relative" {{ with $file }}id="{{ . | urlize}}"{{ end }}>
- <div class="code-nav flex flex-nowrap items-stretch">
- {{- with $file -}}
- <div class="san-serif f6 dib lh-solid pl2 pv2 mr2">{{ . }}.</div>
- {{- end -}}
- {{ range $langs }}
- <button data-toggle-tab="{{ . }}" class="tab-button {{ cond (eq . "yaml") "active" ""}} ba san-serif f6 dib lh-solid ph2 pv2">{{ . }}</button>&nbsp;
- {{ end }}
- </div>
- <div class="tab-content">
- {{ range $langs }}
- <div data-pane="{{ . }}" class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" ""}}">
- {{ highlight ($code | transform.Remarshal . | safeHTML) . ""}}
- </div>
- {{ if ne ($.Get "copy") "false" }}
- <button class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button">
- </button>
- {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
- {{end}}
- {{ end }}
- </div>
-
+ <div class="code-nav flex flex-nowrap items-stretch">
+ {{- with $file -}}
+ <div class="san-serif f6 dib lh-solid pl2 pv2 mr2">
+ {{ . }}.
+ </div>
+ {{- end -}}
+ {{ range $langs }}
+ <button data-toggle-tab="{{ . }}" class="tab-button {{ cond (eq . "yaml") "active" ""}} ba san-serif f6 dib lh-solid ph2 pv2">
+ {{ . }}
+ </button>
+ &nbsp;
+ {{ end }}
+ </div>
+ <div class="tab-content">
+ {{ range $langs }}
+ <div data-pane="{{ . }}" class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" ""}}">
+ {{ highlight ($code | transform.Remarshal . | safeHTML) . ""}}
+ </div>
+ {{ if ne ($.Get "copy") "false" }}
+ <button class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button"></button>
+ {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
+ {{end}}
+ {{ end }}
+ </div>
+
</div>