abc
" → <p>abc</p> +{{ transform.XMLEscape "abc
" }} → <p>abc</p> ``` When using `transform.XMLEscape` in a template rendered by Go's [html/template] package, declare the string to be safe HTML to avoid double escaping. For example, in an RSS template: diff --git a/docs/content/en/getting-started/configuration.md b/docs/content/en/getting-started/configuration.md index 5e861759b..3ce0077ba 100644 --- a/docs/content/en/getting-started/configuration.md +++ b/docs/content/en/getting-started/configuration.md @@ -15,61 +15,117 @@ aliases: [/overview/source-directory/,/overview/configuration/] ## Configuration file -Hugo uses the `hugo.toml`, `hugo.yaml`, or `hugo.json` (if found in the -site root) as the default site configuration file. +Create a site configuration file in the root of your project directory, naming it `hugo.toml`, `hugo.yaml`, or `hugo.json`, with that order of precedence. -The user can choose to override that default with one or more site configuration files using the command-line `--config` switch. - -Examples: - -```txt -hugo --config debugconfig.toml -hugo --config a.toml,b.toml,c.toml +```text +my-project/ +└── hugo.toml ``` {{% note %}} -Multiple site configuration files can be specified as a comma-separated string to the `--config` switch. +With v0.109.0 and earlier the basename of the site configuration file was `config` instead of `hugo`. You can use either, but should transition to the new naming convention when practical. {{% /note %}} -## hugo.toml vs config.toml +A simple example: -In Hugo 0.110.0 we changed the default configuration base file name to `hugo`, e.g. `hugo.toml`. We will still look for `config.toml` etc., but we recommend you eventually rename it (but you need to wait if you want to support older Hugo versions). The main reason we're doing this is to make it easier for code editors and build tools to identify this as a Hugo configuration file and project. +{{< code-toggle file=hugo >}} +baseURL = 'https://example.org/' +languageCode = 'en-us' +title = 'ABC Widgets, Inc.' +[params] +subtitle = 'The Best Widgets on Earth' +[params.contact] +email = 'info@example.org' +phone = '+1 202-555-1212' +{{< /code-toggle >}} -{{< new-in 0.110.0 >}} +To use a different configuration file when building your site, use the `--config` flag: + +```sh +hugo --config other.toml +``` + +Combine two or more configuration files, with left-to-right precedence: + +```sh +hugo --config a.toml,b.yaml,c.json +``` + +{{% note %}} +See the specifications for each file format: [TOML], [YAML], and [JSON]. + +[TOML]: https://toml.io/en/latest +[YAML]: https://yaml.org/spec/ +[JSON]: https://datatracker.ietf.org/doc/html/rfc7159 +{{% /note %}} ## Configuration directory -In addition to using a single site configuration file, one can use the `configDir` directory (default to `config/`) to maintain easier organization and environment specific settings. +Instead of a single site configuration file, split your configuration by [environment], root configuration key, and language. For example: -- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc... -- Each file's content must be top-level, for example: +[environment]: /getting-started/glossary/#environment -{{< code-toggle file="hugo" copy=false >}} -[Params] - foo = "bar" +```text +my-project/ +└── config/ + ├── _default/ + │ ├── hugo.toml + │ ├── menus.en.toml + │ ├── menus.de.toml + │ └── params.toml + ├── production/ + │ ├── hugo.toml + │ └── params.toml + └── staging/ + ├── hugo.toml + └── params.toml +``` + +The root configuration keys are `build`, `caches`, `cascade`, `deployment`, `frontmatter`, `imaging`, `languages`, `markup`, `mediatypes`, `menus`, `minify`, `module`, `outputformats`, `outputs`, `params`, `permalinks`, `privacy`, `related`, `security`, `server`, `services`, `sitemap`, and `taxonomies`. + +### Omit the root key + +When splitting the configuration by root key, omit the root key in the given file. For example, these are equivalent: + +{{< code-toggle file=hugo >}} +[params] +foo = 'bar' {{< /code-toggle >}} -{{< code-toggle file="params" copy=false >}} -foo = "bar" +{{< code-toggle file=params >}} +foo = 'bar' {{< /code-toggle >}} -- Each directory holds a group of files containing settings unique to an environment. -- Files can be localized to become language specific. +### Recursive parsing -```txt -├── config -│ ├── _default -│ │ ├── hugo.toml -│ │ ├── languages.toml -│ │ ├── menus.en.toml -│ │ ├── menus.zh.toml -│ │ └── params.toml -│ ├── production -│ │ ├── hugo.toml -│ │ └── params.toml -│ └── staging -│ ├── hugo.toml -│ └── params.toml +Hugo parses the `config` directory recursively, allowing you to organize the files into subdirectories. For example: + +```text +my-project/ +└── config/ + └── _default/ + ├── navigation/ + │ ├── menus.de.toml + │ └── menus.en.toml + └── hugo.toml +``` + +### Example + +```text +my-project/ +└── config/ + ├── _default/ + │ ├── hugo.toml + │ ├── menus.en.toml + │ ├── menus.de.toml + │ └── params.toml + ├── production/ + │ ├── hugo.toml + │ └── params.toml + └── staging/ + ├── hugo.toml + └── params.toml ``` Considering the structure above, when running `hugo --environment staging`, Hugo will use every setting from `config/_default` and merge `staging`'s on top of those. @@ -144,356 +200,272 @@ Note that you don't need to be so verbose as in the default setup below; a `_mer ## All configuration settings -The following is the full list of Hugo-defined variables. Users may choose to override those values in their site configuration file(s). +###### archetypeDir -### archetypeDir +(`string`) The directory where Hugo finds archetype files (content templates). Default is `archetypes`. {{% module-mounts-note %}} -**Default value:** "archetypes" +###### assetDir -The directory where Hugo finds archetype files (content templates). {{% module-mounts-note %}} +(`string`) The directory where Hugo finds asset files used in [Hugo Pipes](/hugo-pipes/). Default is `assets`. {{% module-mounts-note %}} -### assetDir +###### baseURL -**Default value:** "assets" +(`string`) The absolute URL (protocol, host, path, and trailing slash) of your published site (e.g., `https://www.example.org/docs/`). -The directory where Hugo finds asset files used in [Hugo Pipes](/hugo-pipes/). {{% module-mounts-note %}} +###### build -### baseURL +See [Configure Build](#configure-build). -The absolute URL (protocol, host, path, and trailing slash) of your published site (e.g., `https://www.example.org/docs/`). +###### buildDrafts -### build +(`bool`) Include drafts when building. Default is `false`. -See [Configure Build](#configure-build) +###### buildExpired -### buildDrafts (false) +(`bool`) Include content already expired. Default is `false`. -**Default value:** false +###### buildFuture -Include drafts when building. +(`bool`) Include content with publishdate in the future. Default is `false`. -### buildExpired +###### caches -**Default value:** false +See [Configure File Caches](#configure-file-caches). -Include content already expired. - -### buildFuture - -**Default value:** false - -Include content with publishdate in the future. - -### caches - -See [Configure File Caches](#configure-file-caches) - -### cascade +###### cascade Pass down down default configuration values (front matter) to pages in the content tree. The options in site config is the same as in page front matter, see [Front Matter Cascade](/content-management/front-matter#front-matter-cascade). {{% note %}} For a website in a single language, define the `[[cascade]]` in [Front Matter](/content-management/front-matter#front-matter-cascade). For a multilingual website, define the `[[cascade]]` in [Site Config](../../getting-started/configuration/#cascade). -To remain consistent and prevent unexpected behaviour, do not mix these strategies. +To remain consistent and prevent unexpected behavior, do not mix these strategies. {{% /note %}} -### canonifyURLs +###### canonifyURLs -**Default value:** false +(`bool`) Enable to turn relative URLs into absolute. Default is `false`. See [details](/content-management/urls/#canonical-urls). -Enable to turn relative URLs into absolute. See [details](/content-management/urls/#canonical-urls). +###### cleanDestinationDir -### cleanDestinationDir +(`bool`) When building, removes files from destination not found in static directories. Default is `false`. -**Default value:** false +###### contentDir -When building, removes files from destination not found in static directories. +(`string`) The directory from where Hugo reads content files. Default is `content`. {{% module-mounts-note %}} -### contentDir +###### copyright -**Default value:** "content" +(`string`) Copyright notice for your site, typically displayed in the footer. -The directory from where Hugo reads content files. {{% module-mounts-note %}} +###### dataDir -### copyright +(`string`) The directory from where Hugo reads data files. Default is `data`. {{% module-mounts-note %}} -**Default value:** "" +###### defaultContentLanguage -Copyright notice for your site, typically displayed in the footer. +(`string`) Content without language indicator will default to this language. Default is `en`. -### dataDir +###### defaultContentLanguageInSubdir -**Default value:** "data" +(`bool`) Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`. Default is `false`. -The directory from where Hugo reads data files. {{% module-mounts-note %}} +###### disableAliases -### defaultContentLanguage +(`bool`) Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htaccess`, a Netlify `_redirects` file or similar using a custom output format. Default is `false`. -**Default value:** "en" +###### disableHugoGeneratorInject -Content without language indicator will default to this language. +(`bool`) Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise. Default is `false`. -### defaultContentLanguageInSubdir +###### disableKinds -**Default value:** false +(`string slice`) Disable rendering of the specified page [kinds], any of `404`, `home`, `page`, `robotstxt`, `rss`, `section`, `sitemap`, `taxonomy`, or `term`. -Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`. +[kinds]: /getting-started/glossary/#page-kind -### disableAliases +###### disableLiveReload -**Default value:** false +(`bool`) Disable automatic live reloading of browser window. Default is `false`. -Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htaccess`, a Netlify `_redirects` file or similar using a custom output format. +###### disablePathToLower -### disableHugoGeneratorInject +(`bool`) Do not convert the url/path to lowercase. Default is `false`. -**Default value:** false +###### enableEmoji -Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise. +(`bool`) Enable Emoji emoticons support for page content; see the [emoji shortcode quick reference guide](/quick-reference/emojis/). Default is `false`. -### disableKinds +###### enableGitInfo -**Default value:** [] +(`bool`) Enable `.GitInfo` object for each page (if the Hugo site is versioned by Git). This will then update the `Lastmod` parameter for each page using the last git commit date for that content file. Default is `false`. -Enable disabling of all pages of the specified *Kinds*. Allowed values in this list: `"page"`, `"home"`, `"section"`, `"taxonomy"`, `"term"`, `"RSS"`, `"sitemap"`, `"robotsTXT"`, `"404"`. +###### enableMissingTranslationPlaceholders -### disableLiveReload +(`bool`) Show a placeholder instead of the default value or an empty string if a translation is missing. Default is `false`. -**Default value:** false +###### enableRobotsTXT -Disable automatic live reloading of browser window. +(`bool`) Enable generation of `robots.txt` file. Default is `false`. -### disablePathToLower - -**Default value:** false - -Do not convert the url/path to lowercase. - -### enableEmoji - -**Default value:** false - -Enable Emoji emoticons support for page content; see the [emoji shortcode quick reference guide](/quick-reference/emojis/). - -### enableGitInfo - -**Default value:** false - -Enable `.GitInfo` object for each page (if the Hugo site is versioned by Git). This will then update the `Lastmod` parameter for each page using the last git commit date for that content file. - -### enableInlineShortcodes - -**Default value:** false - -Enable inline shortcode support. See [Inline Shortcodes](/templates/shortcode-templates/#inline-shortcodes). - -### enableMissingTranslationPlaceholders - -**Default value:** false - -Show a placeholder instead of the default value or an empty string if a translation is missing. - -### enableRobotsTXT - -**Default value:** false - -Enable generation of `robots.txt` file. - -### frontmatter +###### frontmatter See [Front matter Configuration](#configure-front-matter). -### hasCJKLanguage +###### hasCJKLanguage -**Default value:** false +(`bool`) If true, auto-detect Chinese/Japanese/Korean Languages in the content. This will make `.Summary` and `.WordCount` behave correctly for CJK languages. Default is `false`. -If true, auto-detect Chinese/Japanese/Korean Languages in the content. This will make `.Summary` and `.WordCount` behave correctly for CJK languages. - -### imaging +###### imaging See [image processing configuration](/content-management/image-processing/#imaging-configuration). -### languageCode +###### languageCode -**Default value:** "" - -A language tag as defined by [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). This value is used to populate: +(`string`) A language tag as defined by [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). This value is used to populate: - The `{{ .Fragments.Headings | jsonify (dict "indent" " ") }}``` HeadingsMap -: (`slice`) A slice of maps of all headings on the page, with first-level keys for each heading. Each map contains the following keys: `ID`, `Title` and `Headings`. To inspect the data structure: +: (`slice`) A slice of maps of all headings on the page, with first-level keys for each heading. Each map contains the following keys: `ID`, `Level`, `Title` and `Headings`. To inspect the data structure: ```go-html-template
{{ .Fragments.HeadingsMap | jsonify (dict "indent" " ") }}diff --git a/docs/content/en/methods/page/GetPage.md b/docs/content/en/methods/page/GetPage.md index ed072932a..b1f192d58 100644 --- a/docs/content/en/methods/page/GetPage.md +++ b/docs/content/en/methods/page/GetPage.md @@ -6,7 +6,7 @@ keywords: [] action: related: - methods/site/GetPage - returnType: hugolib.pageState + returnType: page.Page signatures: [PAGE.GetPage PATH] aliases: [/functions/getpage] --- diff --git a/docs/content/en/methods/page/GitInfo.md b/docs/content/en/methods/page/GitInfo.md index 88137614c..9dba2a2b2 100644 --- a/docs/content/en/methods/page/GitInfo.md +++ b/docs/content/en/methods/page/GitInfo.md @@ -34,7 +34,7 @@ hugo --enableGitInfo ``` {{% note %}} -When you set `enableGitInto` to `true`, or enable the feature with the command line flag, the last modification date for each content page will be the Author Date of the last commit for that file. +When you set `enableGitInfo` to `true`, or enable the feature with the command line flag, the last modification date for each content page will be the Author Date of the last commit for that file. This is configurable. See [details]. @@ -43,8 +43,9 @@ This is configurable. See [details]. ## Methods -AbbreviatedHash -: (`string`) The abbreviated commit hash. +###### AbbreviatedHash + +(`string`) The abbreviated commit hash. ```go-html-template {{ with .GitInfo }} @@ -52,8 +53,9 @@ AbbreviatedHash {{ end }} ``` -AuthorDate -: (`time.Time`) The author date. +###### AuthorDate + +(`time.Time`) The author date. ```go-html-template {{ with .GitInfo }} @@ -61,8 +63,9 @@ AuthorDate {{ end }} ``` -AuthorEmail -: (`string`) The author's email address, respecting [gitmailmap]. +###### AuthorEmail + +(`string`) The author's email address, respecting [gitmailmap]. ```go-html-template {{ with .GitInfo }} @@ -70,8 +73,9 @@ AuthorEmail {{ end }} ``` -AuthorName -: (`string`) The author's name, respecting [gitmailmap]. +###### AuthorName + +(`string`) The author's name, respecting [gitmailmap]. ```go-html-template {{ with .GitInfo }} @@ -79,8 +83,19 @@ AuthorName {{ end }} ``` -Hash -: (`string`) The commit hash. +###### CommitDate + +(`time.Time`) The commit date. + +```go-html-template +{{ with .GitInfo }} + {{ .CommitDate.Format "2006-01-02" }} → 2023-10-09 +{{ end }} +``` + +###### Hash + +(`string`) The commit hash. ```go-html-template {{ with .GitInfo }} @@ -88,8 +103,9 @@ Hash {{ end }} ``` -Subject -: (`string`) The commit message subject. +###### Subject + +(`string`) The commit message subject. ```go-html-template {{ with .GitInfo }} diff --git a/docs/content/en/methods/page/Next.md b/docs/content/en/methods/page/Next.md index 3c9e3495a..57fc1f2f8 100644 --- a/docs/content/en/methods/page/Next.md +++ b/docs/content/en/methods/page/Next.md @@ -10,7 +10,7 @@ action: - methods/page/PrevInSection - methods/pages/Next - methods/pages/Prev - returnType: hugolib.pageState + returnType: page.Page signatures: [PAGE.Next] toc: true --- diff --git a/docs/content/en/methods/page/NextInSection.md b/docs/content/en/methods/page/NextInSection.md index b48ddcc62..73f82d754 100644 --- a/docs/content/en/methods/page/NextInSection.md +++ b/docs/content/en/methods/page/NextInSection.md @@ -10,7 +10,7 @@ action: - methods/page/Prev - methods/pages/Next - methods/pages/Prev - returnType: hugolib.pageState + returnType: page.Page signatures: [PAGE.NextInSection] --- diff --git a/docs/content/en/methods/page/Page.md b/docs/content/en/methods/page/Page.md index 2c0536bee..4d81c04ef 100644 --- a/docs/content/en/methods/page/Page.md +++ b/docs/content/en/methods/page/Page.md @@ -5,7 +5,7 @@ categories: [] keywords: [] action: related: [] - returnType: hugolib.pageState + returnType: page.Page signatures: [PAGE.Page] --- diff --git a/docs/content/en/methods/page/Params.md b/docs/content/en/methods/page/Params.md index ce624c394..3d79d15c5 100644 --- a/docs/content/en/methods/page/Params.md +++ b/docs/content/en/methods/page/Params.md @@ -18,7 +18,6 @@ With this front matter: title = 'Annual conference' date = 2023-10-17T15:11:37-07:00 display_related = true -event-date = '2023' [params.author] email = 'jsmith@example.org' name = 'John Smith' @@ -36,8 +35,9 @@ Access the custom parameters by [chaining] the [identifiers]: In the template example above, each of the keys is a valid identifier. For example, none of the keys contains a hyphen. To access a key that is not a valid identifier, use the [`index`] function: ```go-html-template -{{ index .Params "event-date" }} → 2023 +{{ index .Params "key-with-hyphens" }} → 2023 ``` + [`index`]: /functions/collections/indexfunction [chaining]: /getting-started/glossary/#chain [identifiers]: /getting-started/glossary/#identifier diff --git a/docs/content/en/methods/page/Parent.md b/docs/content/en/methods/page/Parent.md index dbd2cb9b3..9d9ed7ea3 100644 --- a/docs/content/en/methods/page/Parent.md +++ b/docs/content/en/methods/page/Parent.md @@ -12,7 +12,7 @@ action: - methods/page/IsAncestor - methods/page/IsDescendant - methods/page/Sections - returnType: hugolib.pageState + returnType: page.Page signatures: [PAGE.Parent] --- diff --git a/docs/content/en/methods/page/Permalink.md b/docs/content/en/methods/page/Permalink.md index be6df5aad..d8416df86 100644 --- a/docs/content/en/methods/page/Permalink.md +++ b/docs/content/en/methods/page/Permalink.md @@ -21,5 +21,5 @@ Template: ```go-html-template {{ $page := .Site.GetPage "/about" }} -{{ $page.RelPermalink }} → https://example.org/docs/about/ +{{ $page.Permalink }} → https://example.org/docs/about/ ``` diff --git a/docs/content/en/methods/page/Prev.md b/docs/content/en/methods/page/Prev.md index cde83b0f2..b1a503af5 100644 --- a/docs/content/en/methods/page/Prev.md +++ b/docs/content/en/methods/page/Prev.md @@ -10,7 +10,7 @@ action: - methods/page/NextInSection - methods/pages/Prev - methods/pages/Next - returnType: hugolib.pageState + returnType: page.Page signatures: [PAGE.Prev] toc: true --- diff --git a/docs/content/en/methods/page/PrevInSection.md b/docs/content/en/methods/page/PrevInSection.md index 30b813350..c09e4580f 100644 --- a/docs/content/en/methods/page/PrevInSection.md +++ b/docs/content/en/methods/page/PrevInSection.md @@ -10,7 +10,7 @@ action: - methods/pages/Next - methods/page/Prev - methods/pages/Prev - returnType: hugolib.pageState + returnType: page.Page signatures: [PAGE.PrevInSection] --- diff --git a/docs/content/en/methods/page/RelPermalink.md b/docs/content/en/methods/page/RelPermalink.md index 8a5972ccc..817e3c862 100644 --- a/docs/content/en/methods/page/RelPermalink.md +++ b/docs/content/en/methods/page/RelPermalink.md @@ -21,5 +21,5 @@ Template: ```go-html-template {{ $page := .Site.GetPage "/about" }} -{{ $page.Permalink }} → /docs/about/ +{{ $page.RelPermalink }} → /docs/about/ ``` diff --git a/docs/content/en/methods/page/Resources.md b/docs/content/en/methods/page/Resources.md index a9fa3dab2..140b50020 100644 --- a/docs/content/en/methods/page/Resources.md +++ b/docs/content/en/methods/page/Resources.md @@ -21,8 +21,9 @@ To work with global or remote resources, see the [`resources`] functions. ## Methods -ByType -: (`resource.Resources`) Returns a collection of page resources of the given [media type], or nil if none found. The media type is typically one of `image`, `text`, `audio`, `video`, or `application`. +###### ByType + +(`resource.Resources`) Returns a collection of page resources of the given [media type], or nil if none found. The media type is typically one of `image`, `text`, `audio`, `video`, or `application`. ```go-html-template {{ range .Resources.ByType "image" }} @@ -32,8 +33,9 @@ ByType When working with global resources instead of page resources, use the [`resources.ByType`] function. -Get -: (`resource.Resource`) Returns a page resource from the given path, or nil if none found. +###### Get + +(`resource.Resource`) Returns a page resource from the given path, or nil if none found. ```go-html-template {{ with .Resources.Get "images/a.jpg" }} @@ -43,8 +45,9 @@ Get When working with global resources instead of page resources, use the [`resources.Get`] function. -GetMatch -: (`resource.Resource`) Returns the first page resource from paths matching the given [glob pattern], or nil if none found. +###### GetMatch + +(`resource.Resource`) Returns the first page resource from paths matching the given [glob pattern], or nil if none found. ```go-html-template {{ with .Resources.GetMatch "images/*.jpg" }} @@ -54,8 +57,9 @@ GetMatch When working with global resources instead of page resources, use the [`resources.GetMatch`] function. -Match -: (`resource.Resources`) Returns a collection of page resources from paths matching the given [glob pattern], or nil if none found. +###### Match + +(`resource.Resources`) Returns a collection of page resources from paths matching the given [glob pattern], or nil if none found. ```go-html-template {{ range .Resources.Match "images/*.jpg" }} diff --git a/docs/content/en/methods/page/Store.md b/docs/content/en/methods/page/Store.md index 04e1d5256..8bc16034b 100644 --- a/docs/content/en/methods/page/Store.md +++ b/docs/content/en/methods/page/Store.md @@ -22,25 +22,28 @@ To create a locally scoped scratch pad that is not attached to a `Page` object, ## Methods -Set -: Sets the value of a given key. +###### Set + +Sets the value of a given key. ```go-html-template {{ .Store.Set "greeting" "Hello" }} ``` -Get -: Gets the value of a given key. +###### Get + +Gets the value of a given key. ```go-html-template {{ .Store.Set "greeting" "Hello" }} {{ .Store.Get "greeting" }} → Hello ``` -Add -: Adds a given value to existing value(s) of the given key. +###### Add -: For single values, `Add` accepts values that support Go's `+` operator. If the first `Add` for a key is an array or slice, the following adds will be appended to that list. +Adds a given value to existing value(s) of the given key. + +For single values, `Add` accepts values that support Go's `+` operator. If the first `Add` for a key is an array or slice, the following adds will be appended to that list. ```go-html-template {{ .Store.Set "greeting" "Hello" }} @@ -60,8 +63,9 @@ Add {{ .Store.Get "greetings" }} → [Hello Welcome Cheers] ``` -SetInMap -: Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`. +###### SetInMap + +Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`. ```go-html-template {{ .Store.SetInMap "greetings" "english" "Hello" }} @@ -69,8 +73,9 @@ SetInMap {{ .Store.Get "greetings" }} → map[english:Hello french:Bonjour] ``` -DeleteInMap -: Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`. +###### DeleteInMap + +Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`. ```go-html-template {{ .Store.SetInMap "greetings" "english" "Hello" }} @@ -79,8 +84,9 @@ DeleteInMap {{ .Store.Get "greetings" }} → map[french:Bonjour] ``` -GetSortedMapValues -: Returns an array of values from `key` sorted by `mapKey`. +###### GetSortedMapValues + +Returns an array of values from `key` sorted by `mapKey`. ```go-html-template {{ .Store.SetInMap "greetings" "english" "Hello" }} @@ -88,8 +94,9 @@ GetSortedMapValues {{ .Store.GetSortedMapValues "greetings" }} → [Hello Bonjour] ``` -Delete -: Removes the given key. +###### Delete + +Removes the given key. ```go-html-template {{ .Store.Set "greeting" "Hello" }} diff --git a/docs/content/en/methods/page/Translations.md b/docs/content/en/methods/page/Translations.md index 7aaee75ab..1ed256630 100644 --- a/docs/content/en/methods/page/Translations.md +++ b/docs/content/en/methods/page/Translations.md @@ -63,8 +63,9 @@ And this template: {{ with .Translations }}