]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Merge commit 'e4bfe59c4e043c92d3992587d8c64d264b262a22'
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 31 May 2022 08:22:05 +0000 (10:22 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 31 May 2022 08:22:05 +0000 (10:22 +0200)
1  2 
docs/content/en/content-management/multilingual.md
docs/content/en/getting-started/usage.md
docs/content/en/templates/introduction.md
docs/netlify.toml

index 82d95f6f16e1cf914e908c770deb624d331b2a57,0000000000000000000000000000000000000000..2eeb1aa1b0413dbf0af24018764175cf68fc3c2a
mode 100644,000000..100644
--- /dev/null
@@@ -1,582 -1,0 +1,582 @@@
- To track down missing translation strings, run Hugo with the `--i18n-warnings` flag:
 +---
 +title: Multilingual Mode
 +linktitle: Multilingual
 +description: Hugo supports the creation of websites with multiple languages side by side.
 +date: 2017-01-10
 +publishdate: 2017-01-10
 +lastmod: 2017-01-10
 +categories: [content management]
 +keywords: [multilingual,i18n, internationalization]
 +menu:
 +  docs:
 +    parent: "content-management"
 +    weight: 150
 +weight: 150   #rem
 +draft: false
 +aliases: [/content/multilingual/,/tutorials/create-a-multilingual-site/]
 +toc: true
 +---
 +
 +You should define the available languages in a `languages` section in your site configuration.
 +
 +> Also See [Hugo Multilingual Part 1: Content translation]
 +
 +## Configure Languages
 +
 +The following is an example of a site configuration for a multilingual Hugo project:
 +
 +{{< code-toggle file="config" >}}
 +defaultContentLanguage = "en"
 +copyright = "Everything is mine"
 +
 +[params]
 +[params.navigation]
 +help  = "Help"
 +
 +[languages]
 +[languages.en]
 +title = "My blog"
 +weight = 1
 +[languages.en.params]
 +linkedin = "https://linkedin.com/whoever"
 +
 +[languages.fr]
 +title = "Mon blogue"
 +weight = 2
 +[languages.fr.params]
 +linkedin = "https://linkedin.com/fr/whoever"
 +[languages.fr.params.navigation]
 +help  = "Aide"
 +
 +[languages.ar]
 +title = "مدونتي"
 +weight = 2
 +languagedirection = "rtl"
 +
 +[languages.pt-pt]
 +title = "O meu blog"
 +weight = 3
 +{{< /code-toggle >}}
 +
 +Anything not defined in a `languages` block will fall back to the global value for that key (e.g., `copyright` for the English `en` language). This also works for `params`, as demonstrated with `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set.
 +
 +With the configuration above, all content, sitemap, RSS feeds, paginations,
 +and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
 +
 +When working with front matter `Params` in [single page templates], omit the `params` in the key for the translation.
 +
 +`defaultContentLanguage` sets the project's default language. If not set, the default language will be `en`.
 +
 +If the default language needs to be rendered below its own language code (`/en`) like the others, set `defaultContentLanguageInSubdir: true`.
 +
 +Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc.
 +
 +**Please note:** use lowercase language codes, even when using regional languages (ie. use pt-pt instead of pt-PT). Currently Hugo language internals lowercase language codes, which can cause conflicts with settings like `defaultContentLanguage` which are not lowercased. Please track the evolution of this issue in [Hugo repository issue tracker](https://github.com/gohugoio/hugo/issues/7344)
 +
 +### Disable a Language
 +
 +You can disable one or more languages. This can be useful when working on a new translation.
 +
 +{{< code-toggle file="config" >}}
 +disableLanguages = ["fr", "ja"]
 +{{< /code-toggle >}}
 +
 +Note that you cannot disable the default content language.
 +
 +We kept this as a standalone setting to make it easier to set via [OS environment]:
 +
 +```bash
 +HUGO_DISABLELANGUAGES="fr ja" hugo
 +```
 +
 +If you have already a list of disabled languages in `config.toml`, you can enable them in development like this:
 +
 +```bash
 +HUGO_DISABLELANGUAGES=" " hugo server
 +```
 +
 +### Configure Multilingual Multihost
 +
 +From **Hugo 0.31** we support multiple languages in a multihost configuration. See [this issue](https://github.com/gohugoio/hugo/issues/4027) for details.
 +
 +This means that you can now configure a `baseURL` per `language`:
 +
 +> If a `baseURL` is set on the `language` level, then all languages must have one and they must all be different.
 +
 +Example:
 +
 +{{< code-toggle file="config" >}}
 +[languages]
 +[languages.fr]
 +baseURL = "https://example.fr"
 +languageName = "Français"
 +weight = 1
 +title = "En Français"
 +
 +[languages.en]
 +baseURL = "https://example.com"
 +languageName = "English"
 +weight = 2
 +title = "In English"
 +{{</ code-toggle >}}
 +
 +With the above, the two sites will be generated into `public` with their own root:
 +
 +```text
 +public
 +├── en
 +└── fr
 +```
 +
 +**All URLs (i.e `.Permalink` etc.) will be generated from that root. So the English home page above will have its `.Permalink` set to `https://example.com/`.**
 +
 +When you run `hugo server` we will start multiple HTTP servers. You will typically see something like this in the console:
 +
 +```text
 +Web Server is available at 127.0.0.1:1313 (bind address 127.0.0.1)
 +Web Server is available at 127.0.0.1:1314 (bind address 127.0.0.1)
 +Press Ctrl+C to stop
 +```
 +
 +Live reload and `--navigateToChanged` between the servers work as expected.
 +
 +### Taxonomies and Blackfriday
 +
 +Taxonomies and [Blackfriday configuration][config] can also be set per language:
 +
 +{{< code-toggle file="config" >}}
 +[Taxonomies]
 +tag = "tags"
 +
 +[blackfriday]
 +angledQuotes = true
 +hrefTargetBlank = true
 +
 +[languages]
 +[languages.en]
 +weight = 1
 +title = "English"
 +[languages.en.blackfriday]
 +angledQuotes = false
 +
 +[languages.fr]
 +weight = 2
 +title = "Français"
 +[languages.fr.Taxonomies]
 +plaque = "plaques"
 +{{</ code-toggle >}}
 +
 +## Translate Your Content
 +
 +There are two ways to manage your content translations. Both ensure each page is assigned a language and is linked to its counterpart translations.
 +
 +### Translation by filename
 +
 +Considering the following example:
 +
 +1. `/content/about.en.md`
 +2. `/content/about.fr.md`
 +
 +The first file is assigned the English language and is linked to the second.
 +The second file is assigned the French language and is linked to the first.
 +
 +Their language is __assigned__ according to the language code added as a __suffix to the filename__.
 +
 +By having the same **path and base filename**, the content pieces are __linked__ together as translated pages.
 +
 +{{< note >}}
 +If a file has no language code, it will be assigned the default language.
 +{{</ note >}}
 +
 +### Translation by content directory
 +
 +This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` param.
 +
 +{{< code-toggle file="config" >}}
 +languages:
 +  en:
 +    weight: 10
 +    languageName: "English"
 +    contentDir: "content/english"
 +  fr:
 +    weight: 20
 +    languageName: "Français"
 +    contentDir: "content/french"
 +{{< /code-toggle >}}
 +
 +The value of `contentDir` can be any valid path -- even absolute path references. The only restriction is that the content directories cannot overlap.
 +
 +Considering the following example in conjunction with the configuration above:
 +
 +1. `/content/english/about.md`
 +2. `/content/french/about.md`
 +
 +The first file is assigned the English language and is linked to the second.
 +The second file is assigned the French language and is linked to the first.
 +
 +Their language is __assigned__ according to the content directory they are __placed__ in.
 +
 +By having the same **path and basename** (relative to their language content directory), the content pieces are __linked__ together as translated pages.
 +
 +### Bypassing default linking
 +
 +Any pages sharing the same `translationKey` set in front matter will be linked as translated pages regardless of basename or location.
 +
 +Considering the following example:
 +
 +1. `/content/about-us.en.md`
 +2. `/content/om.nn.md`
 +3. `/content/presentation/a-propos.fr.md`
 +
 +{{< code-toggle >}}
 +translationKey: "about"
 +{{< /code-toggle >}}
 +
 +By setting the `translationKey` front matter param to `about` in all three pages, they will be __linked__ as translated pages.
 +
 +### Localizing permalinks
 +
 +Because paths and filenames are used to handle linking, all translated pages will share the same URL (apart from the language subdirectory).
 +
 +To localize the URLs, the [`slug`]({{< ref "/content-management/organization/index.md#slug" >}}) or [`url`]({{< ref "/content-management/organization/index.md#url" >}}) front matter param can be set in any of the non-default language file.
 +
 +For example, a French translation (`content/about.fr.md`) can have its own localized slug.
 +
 +{{< code-toggle >}}
 +Title: A Propos
 +slug: "a-propos"
 +{{< /code-toggle >}}
 +
 +At render, Hugo will build both `/about/` and `/fr/a-propos/` while maintaining their translation linking.
 +
 +{{% note %}}
 +If using `url`, remember to include the language part as well: `/fr/compagnie/a-propos/`.
 +{{%/ note %}}
 +
 +### Page Bundles
 +
 +To avoid the burden of having to duplicate files, each Page Bundle inherits the resources of its linked translated pages' bundles except for the content files (markdown files, html files etc...).
 +
 +Therefore, from within a template, the page will have access to the files from all linked pages' bundles.
 +
 +If, across the linked bundles, two or more files share the same basename, only one will be included and chosen as follows:
 +
 +* File from current language bundle, if present.
 +* First file found across bundles by order of language `Weight`.
 +
 +{{% note %}}
 +Page Bundle resources follow the same language assignment logic as content files, both by filename (`image.jpg`, `image.fr.jpg`) and by directory (`english/about/header.jpg`, `french/about/header.jpg`).
 +{{%/ note %}}
 +
 +## Reference the Translated Content
 +
 +To create a list of links to translated content, use a template similar to the following:
 +
 +{{< code file="layouts/partials/i18nlist.html" >}}
 +{{ if .IsTranslated }}
 +<h4>{{ i18n "translations" }}</h4>
 +<ul>
 +  {{ range .Translations }}
 +  <li>
 +    <a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}</a>
 +  </li>
 +  {{ end }}
 +</ul>
 +{{ end }}
 +{{< /code >}}
 +
 +The above can be put in a `partial` (i.e., inside `layouts/partials/`) and included in any template, whether a [single content page][contenttemplate] or the [homepage]. It will not print anything if there are no translations for a given page.
 +
 +The above also uses the [`i18n` function][i18func] described in the next section.
 +
 +### List All Available Languages
 +
 +`.AllTranslations` on a `Page` can be used to list all translations, including the page itself. On the home page it can be used to build a language navigator:
 +
 +{{< code file="layouts/partials/allLanguages.html" >}}
 +<ul>
 +{{ range $.Site.Home.AllTranslations }}
 +<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
 +{{ end }}
 +</ul>
 +{{< /code >}}
 +
 +## Translation of Strings
 +
 +Hugo uses [go-i18n] to support string translations. [See the project's source repository][go-i18n-source] to find tools that will help you manage your translation workflows.
 +
 +Translations are collected from the `themes/<THEME>/i18n/` folder (built into the theme), as well as translations present in `i18n/` at the root of your project. In the `i18n`, the translations will be merged and take precedence over what is in the theme folder. Language files should be named according to [RFC 5646] with names such as `en-US.toml`, `fr.toml`, etc.
 +
 +Artificial languages with private use subtags as defined in [RFC 5646 &#167; 2.2.7](https://datatracker.ietf.org/doc/html/rfc5646#section-2.2.7) are also supported. You may omit the `art-x-` prefix for brevity. For example:
 +
 +```text
 +art-x-hugolang
 +hugolang
 +```
 +
 +Private use subtags must not exceed 8 alphanumeric characters.
 +
 +### Query basic translation
 +
 +From within your templates, use the `i18n` function like this:
 +
 +```go-html-template
 +{{ i18n "home" }}
 +```
 +
 +The function will search for the `"home"` id:
 +
 +{{< code-toggle file="i18n/en-US" >}}
 +[home]
 +other = "Home"
 +{{< /code-toggle >}}
 +
 +The result will be
 +
 +```text
 +Home
 +```
 +
 +### Query a flexible translation with variables
 +
 +Often you will want to use the page variables in the translation strings. To do so, pass the `.` context when calling `i18n`:
 +
 +```go-html-template
 +{{ i18n "wordCount" . }}
 +```
 +
 +The function will pass the `.` context to the `"wordCount"` id:
 +
 +{{< code-toggle file="i18n/en-US" >}}
 +[wordCount]
 +other = "This article has {{ .WordCount }} words."
 +{{< /code-toggle >}}
 +
 +Assume `.WordCount` in the context has value is 101. The result will be:
 +
 +```text
 +This article has 101 words.
 +```
 +
 +### Query a singular/plural translation
 +
 +In order to meet singular/plural requirement, you must pass a dictionary (map) with a numeric `.Count` property to the `i18n` function. The below example uses `.ReadingTime` variable which has a built-in `.Count` property.
 +
 +```go-html-template
 +{{ i18n "readingTime" .ReadingTime }}
 +```
 +
 +The function will read `.Count` from `.ReadingTime` and evaluate where the number is singular (`one`) or plural (`other`). After that, it will pass to `readingTime` id:
 +
 +{{< code-toggle file="i18n/en-US" >}}
 +[readingTime]
 +one = "One minute to read"
 +other = "{{.Count}} minutes to read"
 +{{< /code-toggle >}}
 +
 +Assume `.ReadingTime.Count` in the context has value of 525600. The result will be:
 +
 +```text
 +525600 minutes to read
 +```
 +
 +If `.ReadingTime.Count` in the context has value is 1. The result is:
 +
 +```text
 +One minute to read
 +```
 +
 +In case you need to pass custom data: (`(dict "Count" 25)` is minimum requirement)
 +
 +```go-html-template
 +{{ i18n "readingTime" (dict "Count" 25 "FirstArgument" true "SecondArgument" false "Etc" "so on, so far") }}
 +```
 +
 +## Localization
 +
 +The following localization examples assume your site's primary language is English, with translations to French and German.
 +
 +{{< code-toggle file="config" >}}
 +defaultContentLang = 'en'
 +
 +[languages]
 +[languages.en]
 +contentDir = 'content/en'
 +languageName = 'English'
 +weight = 1
 +[languages.fr]
 +contentDir = 'content/fr'
 +languageName = 'Français'
 +weight = 2
 +[languages.de]
 +contentDir = 'content/de'
 +languageName = 'Deutsch'
 +weight = 3
 +
 +{{< /code-toggle >}}
 +
 +### Dates
 +
 +With this front matter:
 +
 +{{< code-toggle >}}
 +date = 2021-11-03T12:34:56+01:00
 +{{< /code-toggle >}}
 +
 +And this template code:
 +
 +```go-html-template
 +{{ .Date | time.Format ":date_full" }}
 +```
 +
 +The rendered page displays:
 +
 +Language|Value
 +:--|:--
 +English|Wednesday, November 3, 2021
 +Français|mercredi 3 novembre 2021
 +Deutsch|Mittwoch, 3. November 2021
 +
 +See [time.Format] for details.
 +
 +### Currency
 +
 +With this template code:
 +
 +```go-html-template
 +{{ 512.5032 | lang.FormatCurrency 2 "USD" }}
 +```
 +
 +The rendered page displays:
 +
 +Language|Value
 +:--|:--
 +English|$512.50
 +Français|512,50 $US
 +Deutsch|512,50 $
 +
 +See [lang.FormatCurrency] and [lang.FormatAccounting] for details.
 +
 +### Numbers
 +
 +With this template code:
 +
 +```go-html-template
 +{{ 512.5032 | lang.FormatNumber 2 }}
 +```
 +
 +The rendered page displays:
 +
 +Language|Value
 +:--|:--
 +English|512.50
 +Français|512,50
 +Deutsch|512,50
 +
 +See [lang.FormatNumber] and [lang.FormatNumberCustom] for details.
 +
 +### Percentages
 +
 +With this template code:
 +
 +```go-html-template
 +{{ 512.5032 | lang.FormatPercent 2 }} ---> 512.50%
 +```
 +
 +The rendered page displays:
 +
 +Language|Value
 +:--|:--
 +English|512.50%
 +Français|512,50 %
 +Deutsch|512,50 %
 +
 +See [lang.FormatPercent] for details.
 +
 +## Menus
 +
 +You can define your menus for each language independently. Creating multilingual menus works just like [creating regular menus][menus], except they're defined in language-specific blocks in the configuration file:
 +
 +{{< code-toggle file="config" >}}
 +defaultContentLanguage = "en"
 +
 +[languages.en]
 +weight = 0
 +languageName = "English"
 +
 +[[languages.en.menu.main]]
 +url    = "/"
 +name   = "Home"
 +weight = 0
 +
 +[languages.de]
 +weight = 10
 +languageName = "Deutsch"
 +
 +[[languages.de.menu.main]]
 +url    = "/"
 +name   = "Startseite"
 +weight = 0
 +{{< /code-toggle >}}
 +
 +The rendering of the main navigation works as usual. `.Site.Menus` will just contain the menu in the current language. Note that `absLangURL` below will link to the correct locale of your website. Without it, menu entries in all languages would link to the English version, since it's the default content language that resides in the root directory.
 +
 +```go-html-template
 +<ul>
 +    {{- $currentPage := . -}}
 +    {{ range .Site.Menus.main -}}
 +    <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
 +        <a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
 +    </li>
 +    {{- end }}
 +</ul>
 +```
 +
 +## Missing Translations
 +
 +If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
 +
 +While translating a Hugo website, it can be handy to have a visual indicator of missing translations. The [`enableMissingTranslationPlaceholders` configuration option][config] will flag all untranslated strings with the placeholder `[i18n] identifier`, where `identifier` is the id of the missing translation.
 +
 +{{% note %}}
 +Hugo will generate your website with these missing translation placeholders. It might not be suitable for production environments.
 +{{% /note %}}
 +
 +For merging of content from other languages (i.e. missing content translations), see [lang.Merge].
 +
- hugo --i18n-warnings | grep i18n
++To track down missing translation strings, run Hugo with the `--printI18nWarnings` flag:
 +
 +```bash
++hugo --printI18nWarnings | grep i18n
 +i18n|MISSING_TRANSLATION|en|wordCount
 +```
 +
 +## Multilingual Themes support
 +
 +To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria:
 +
 +* Come from the built-in `.Permalink` or `.RelPermalink`
 +* Be constructed with the [`relLangURL` template function][rellangurl] or the [`absLangURL` template function][abslangurl] **OR** be prefixed with `{{ .LanguagePrefix }}`
 +
 +If there is more than one language defined, the `LanguagePrefix` variable will equal `/en` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string (and is therefore harmless for single-language Hugo websites).
 +
 +[abslangurl]: /functions/abslangurl
 +[config]: /getting-started/configuration/
 +[contenttemplate]: /templates/single-page-templates/
 +[go-i18n-source]: https://github.com/nicksnyder/go-i18n
 +[go-i18n]: https://github.com/nicksnyder/go-i18n
 +[homepage]: /templates/homepage/
 +[Hugo Multilingual Part 1: Content translation]: https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/
 +[i18func]: /functions/i18n/
 +[lang.FormatAccounting]: /functions/lang/#langformataccounting
 +[lang.FormatCurrency]: /functions/lang/#langformatcurrency
 +[lang.FormatNumber]: /functions/lang/#langformatnumber
 +[lang.FormatNumberCustom]: /functions/lang/#langformatnumbercustom
 +[lang.FormatPercent]: /functions/lang/#langformatpercent
 +[lang.Merge]: /functions/lang.merge/
 +[menus]: /content-management/menus/
 +[OS environment]: /getting-started/configuration/#configure-with-environment-variables
 +[rellangurl]: /functions/rellangurl
 +[RFC 5646]: https://tools.ietf.org/html/rfc5646
 +[single page templates]: /templates/single-page-templates/
 +[time.Format]: /functions/dateformat
index 96ecb930a265abe1585b6df10062645e822b4984,0000000000000000000000000000000000000000..fc5ae2501525ecfd21554b36f4f172b68273a489
mode 100644,000000..100644
--- /dev/null
@@@ -1,213 -1,0 +1,220 @@@
-   check       Contains some verification checks
 +---
 +title: Basic Usage
 +linktitle: Basic Usage
 +description: Hugo's CLI is fully featured but simple to use, even for those who have very limited experience working from the command line.
 +date: 2017-02-01
 +publishdate: 2017-02-01
 +lastmod: 2017-02-01
 +categories: [getting started]
 +keywords: [usage,livereload,command line,flags]
 +menu:
 +  docs:
 +    parent: "getting-started"
 +    weight: 40
 +weight: 40
 +sections_weight: 40
 +draft: false
 +aliases: [/overview/usage/,/extras/livereload/,/doc/usage/,/usage/]
 +toc: true
 +---
 +
 +The following is a description of the most common commands you will use while developing your Hugo project. See the [Command Line Reference][commands] for a comprehensive view of Hugo's CLI.
 +
 +## Test Installation
 +
 +Once you have [installed Hugo][install], make sure it is in your `PATH`. You can test that Hugo has been installed correctly via the `help` command:
 +
 +```
 +hugo help
 +```
 +
 +The output you see in your console should be similar to the following:
 +
 +```
 +hugo is the main command, used to build your Hugo site.
 +
 +Hugo is a Fast and Flexible Static Site Generator
 +built with love by spf13 and friends in Go.
 +
 +Complete documentation is available at https://gohugo.io/.
 +
 +Usage:
 +  hugo [flags]
 +  hugo [command]
 +
 +Available Commands:
-   -b, --baseURL string         hostname (and path) to the root, e.g. https://spf13.com/
-   -D, --buildDrafts            include content marked as draft
-   -E, --buildExpired           include expired content
-   -F, --buildFuture            include content with publishdate in the future
-       --cacheDir string        filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
-       --cleanDestinationDir    remove files from destination not found in static directories
-       --config string          config file (default is path/config.yaml|json|toml)
-       --configDir string       config dir (default "config")
-   -c, --contentDir string      filesystem path to content directory
-       --debug                  debug output
-   -d, --destination string     filesystem path to write files to
-       --disableKinds strings   disable different kind of pages (home, RSS etc.)
-       --enableGitInfo          add Git revision, date and author info to the pages
-   -e, --environment string     build environment
-       --forceSyncStatic        copy all files when static is changed.
-       --gc                     enable to run some cleanup tasks (remove unused cache files) after the build
-   -h, --help                   help for hugo
-       --i18n-warnings          print missing translations
-       --ignoreCache            ignores the cache directory
-   -l, --layoutDir string       filesystem path to layout directory
-       --log                    enable Logging
-       --logFile string         log File path (if set, logging enabled automatically)
-       --minify                 minify any supported output format (HTML, XML etc.)
-       --noChmod                don't sync permission mode of files
-       --noTimes                don't sync modification time of files
-       --path-warnings          print warnings on duplicate target paths etc.
-       --quiet                  build in quiet mode
-       --renderToMemory         render to memory (only useful for benchmark testing)
-   -s, --source string          filesystem path to read files relative from
-       --templateMetrics        display metrics about template executions
-       --templateMetricsHints   calculate some improvement hints when combined with --templateMetrics
-   -t, --theme strings          themes to use (located in /themes/THEMENAME/)
-       --themesDir string       filesystem path to themes directory
-       --trace file             write trace to file (not useful in general)
-   -v, --verbose                verbose output
-       --verboseLog             verbose logging
-   -w, --watch                  watch filesystem for changes and recreate as needed
++  completion  Generate the autocompletion script for the specified shell
 +  config      Print the site configuration
 +  convert     Convert your content to different formats
++  deploy      Deploy your site to a Cloud provider.
 +  env         Print Hugo version and environment info
 +  gen         A collection of several useful generators.
 +  help        Help about any command
 +  import      Import your site from others.
 +  list        Listing out various types of content
++  mod         Various Hugo Modules helpers.
 +  new         Create new content for your site
 +  server      A high performance webserver
 +  version     Print the version number of Hugo
 +
 +Flags:
++  -b, --baseURL string             hostname (and path) to the root, e.g. https://spf13.com/
++  -D, --buildDrafts                include content marked as draft
++  -E, --buildExpired               include expired content
++  -F, --buildFuture                include content with publishdate in the future
++      --cacheDir string            filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
++      --cleanDestinationDir        remove files from destination not found in static directories
++      --config string              config file (default is path/config.yaml|json|toml)
++      --configDir string           config dir (default "config")
++  -c, --contentDir string          filesystem path to content directory
++      --debug                      debug output
++  -d, --destination string         filesystem path to write files to
++      --disableKinds strings       disable different kind of pages (home, RSS etc.)
++      --enableGitInfo              add Git revision, date, author, and CODEOWNERS info to the pages
++  -e, --environment string         build environment
++      --forceSyncStatic            copy all files when static is changed.
++      --gc                         enable to run some cleanup tasks (remove unused cache files) after the build
++  -h, --help                       help for hugo
++      --ignoreCache                ignores the cache directory
++      --ignoreVendorPaths string   ignores any _vendor for module paths matching the given Glob pattern
++  -l, --layoutDir string           filesystem path to layout directory
++      --log                        enable Logging
++      --logFile string             log File path (if set, logging enabled automatically)
++      --minify                     minify any supported output format (HTML, XML etc.)
++      --noChmod                    don't sync permission mode of files
++      --noTimes                    don't sync modification time of files
++      --panicOnWarning             panic on first WARNING log
++      --poll string                set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
++      --printI18nWarnings          print missing translations
++      --printMemoryUsage           print memory usage to screen at intervals
++      --printPathWarnings          print warnings on duplicate target paths etc.
++      --printUnusedTemplates       print warnings on unused templates.
++      --quiet                      build in quiet mode
++      --renderToMemory             render to memory (only useful for benchmark testing)
++  -s, --source string              filesystem path to read files relative from
++      --templateMetrics            display metrics about template executions
++      --templateMetricsHints       calculate some improvement hints when combined with --templateMetrics
++  -t, --theme strings              themes to use (located in /themes/THEMENAME/)
++      --themesDir string           filesystem path to themes directory
++      --trace file                 write trace to file (not useful in general)
++  -v, --verbose                    verbose output
++      --verboseLog                 verbose logging
++  -w, --watch                      watch filesystem for changes and recreate as needed
 +
 +Use "hugo [command] --help" for more information about a command.
 +```
 +
 +## The `hugo` Command
 +
 +The most common usage is probably to run `hugo` with your current directory being the input directory.
 +
 +This generates your website to the `public/` directory by default, although you can customize the output directory in your [site configuration][config] by changing the `publishDir` field.
 +
 +The command `hugo` renders your site into `public/` dir and is ready to be deployed to your web server:
 +
 +```
 +hugo
 +0 draft content
 +0 future content
 +99 pages created
 +0 paginator pages created
 +16 tags created
 +0 groups created
 +in 90 ms
 +```
 +
 +## Draft, Future, and Expired Content
 +
 +Hugo allows you to set `draft`, `publishdate`, and even `expirydate` in your content's [front matter][]. By default, Hugo will not publish:
 +
 +1. Content with a future `publishdate` value
 +2. Content with `draft: true` status
 +3. Content with a past `expirydate` value
 +
 +All three of these can be overridden during both local development *and* deployment by adding the following flags to `hugo` and `hugo server`, respectively, or by changing the boolean values assigned to the fields of the same name (without `--`) in your [configuration][config]:
 +
 +1. `--buildFuture`
 +2. `--buildDrafts`
 +3. `--buildExpired`
 +
 +## LiveReload
 +
 +Hugo comes with [LiveReload](https://github.com/livereload/livereload-js) built in. There are no additional packages to install. A common way to use Hugo while developing a site is to have Hugo run a server with the `hugo server` command and watch for changes:
 +
 +```
 +hugo server
 +0 draft content
 +0 future content
 +99 pages created
 +0 paginator pages created
 +16 tags created
 +0 groups created
 +in 120 ms
 +Watching for changes in /Users/yourname/sites/yourhugosite/{data,content,layouts,static}
 +Serving pages from /Users/yourname/sites/yourhugosite/public
 +Web Server is available at http://localhost:1313/
 +Press Ctrl+C to stop
 +```
 +
 +This will run a fully functioning web server while simultaneously watching your file system for additions, deletions, or changes within the following areas of your [project organization][dirs]:
 +
 +* `/static/*`
 +* `/content/*`
 +* `/data/*`
 +* `/i18n/*`
 +* `/layouts/*`
 +* `/themes/<CURRENT-THEME>/*`
 +* `config`
 +
 +Whenever you make changes, Hugo will simultaneously rebuild the site and continue to serve content. As soon as the build is finished, LiveReload tells the browser to silently reload the page.
 +
 +Most Hugo builds are so fast that you may not notice the change unless looking directly at the site in your browser. This means that keeping the site open on a second monitor (or another half of your current monitor) allows you to see the most up-to-date version of your website without the need to leave your text editor.
 +
 +{{% note "Closing `</body>` Tag"%}}
 +Hugo injects the LiveReload `<script>` before the closing `</body>` in your templates and will therefore not work if this tag is not present..
 +{{% /note %}}
 +
 +### Redirect automatically to the page you just saved
 +
 +When you are working with more than one document and want to see the markup as real-time as possible it's not ideal to keep jumping between them. 
 +Fortunately Hugo has an easy, embedded and simple solution for this. It's the flag `--navigateToChanged`.
 +
 +### Disable LiveReload
 +
 +LiveReload works by injecting JavaScript into the pages Hugo generates. The script creates a connection from the browser's web socket client to the Hugo web socket server.
 +
 +The following methods make it easy to disable LiveReload:
 +
 +```
 +hugo server --watch=false
 +```
 +
 +Or...
 +
 +```
 +hugo server --disableLiveReload
 +```
 +
 +The latter flag can be omitted by adding the following:
 +
 +{{< code-toggle file="config" >}}
 +disableLiveReload = true
 +{{< /code-toggle >}}
 +
 +## Deploy Your Website
 +
 +After running `hugo server` for local web development, you need to do a final `hugo` run *without the `server` part of the command* to rebuild your site. You may then deploy your site by copying the `public/` directory to your production web server.
 +
 +Since Hugo generates a static website, your site can be hosted *anywhere* using any web server. See [Hosting and Deployment][hosting] for methods for hosting and automating deployments contributed by the Hugo community.
 +
 +{{% warning "Generated Files are **NOT** Removed on Site Build" %}}
 +Running `hugo` *does not* remove generated files before building. This means that you should delete your `public/` directory (or the publish directory you specified via flag or configuration file) before running the `hugo` command. If you do not remove these files, you run the risk of the wrong files (e.g., drafts or future posts) being left in the generated site.
 +{{% /warning %}}
 +
 +
 +[commands]: /commands/
 +[config]: /getting-started/configuration/
 +[dirs]: /getting-started/directory-structure/
 +[front matter]: /content-management/front-matter/
 +[hosting]: /hosting-and-deployment/
 +[install]: /getting-started/installing/
index 801df71ccb9c562c3ed6db82104f5452bf1ca23b,0000000000000000000000000000000000000000..ba66afa86a666180611b3d0c40cdb2e10cd22a5d
mode 100644,000000..100644
--- /dev/null
@@@ -1,686 -1,0 +1,686 @@@
- Vriables can be re-defined using the `=` operator. The example below
 +---
 +title: Introduction to Hugo Templating
 +linktitle: Templating
 +description: Hugo uses Go's `html/template` and `text/template` libraries as the basis for the templating.
 +date: 2017-02-01
 +publishdate: 2017-02-01
 +lastmod: 2017-02-25
 +categories: [templates,fundamentals]
 +keywords: [go]
 +menu:
 +  docs:
 +    parent: "templates"
 +    weight: 10
 +weight: 10
 +sections_weight: 10
 +draft: false
 +aliases: [/layouts/introduction/,/layout/introduction/, /templates/go-templates/]
 +toc: true
 +---
 +
 +{{% note %}}
 +The following is only a primer on Go Templates. For an in-depth look into Go Templates, check the official [Go docs](https://golang.org/pkg/text/template/).
 +{{% /note %}}
 +
 +Go Templates provide an extremely simple template language that adheres to the belief that only the most basic of logic belongs in the template or view layer.
 +
 +## Basic Syntax
 +
 +Go Templates are HTML files with the addition of [variables][variables] and [functions][functions]. Go Template variables and functions are accessible within `{{ }}`.
 +
 +### Access a Predefined Variable
 +
 +A _predefined variable_ could be a variable already existing in the
 +current scope (like the `.Title` example in the [Variables]({{< relref
 +"#variables" >}}) section below) or a custom variable (like the
 +`$address` example in that same section).
 +
 +
 +```go-html-template
 +{{ .Title }}
 +{{ $address }}
 +```
 +
 +Parameters for functions are separated using spaces. The general syntax is:
 +
 +```
 +{{ FUNCTION ARG1 ARG2 .. }}
 +```
 +
 +The following example calls the `add` function with inputs of `1` and `2`:
 +
 +```go-html-template
 +{{ add 1 2 }}
 +```
 +
 +#### Methods and Fields are Accessed via dot Notation
 +
 +Accessing the Page Parameter `bar` defined in a piece of content's [front matter][].
 +
 +```go-html-template
 +{{ .Params.bar }}
 +```
 +
 +#### Parentheses Can be Used to Group Items Together
 +
 +```go-html-template
 +{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
 +```
 +
 +#### A Single Statement Can be Split over Multiple Lines
 +
 +```go-html-template
 +{{ if or 
 +  (isset .Params "alt") 
 +  (isset .Params "caption")
 +}}
 +```
 +
 +#### Raw String Literals Can Include Newlines
 +
 +```go-html-template
 +{{ $msg := `Line one.
 +Line two.` }}
 +```
 +
 +## Variables {#variables}
 +
 +Each Go Template gets a data object. In Hugo, each template is passed
 +a `Page`.  In the below example, `.Title` is one of the elements
 +accessible in that [`Page` variable][pagevars].
 +
 +With the `Page` being the default scope of a template, the `Title`
 +element in current scope (`.` -- "the **dot**") is accessible simply
 +by the dot-prefix (`.Title`):
 +
 +```go-html-template
 +<title>{{ .Title }}</title>
 +```
 +
 +Values can also be stored in custom variables and referenced later:
 +
 +{{% note %}}
 +The custom variables need to be prefixed with `$`.
 +{{% /note %}}
 +
 +```go-html-template
 +{{ $address := "123 Main St." }}
 +{{ $address }}
 +```
++Variables can be re-defined using the `=` operator. The example below
 +prints "Var is Hugo Home" on the home page, and "Var is Hugo Page" on
 +all other pages:
 +
 +```go-html-template
 +{{ $var := "Hugo Page" }}
 +{{ if .IsHome }}
 +    {{ $var = "Hugo Home" }}
 +{{ end }}
 +Var is {{ $var }}
 +```
 +
 +## Functions
 +
 +Go Templates only ship with a few basic functions but also provide a mechanism for applications to extend the original set.
 +
 +[Hugo template functions][functions] provide additional functionality specific to building websites. Functions are called by using their name followed by the required parameters separated by spaces. Template functions cannot be added without recompiling Hugo.
 +
 +### Example 1: Adding Numbers
 +
 +```go-html-template
 +{{ add 1 2 }}
 +<!-- prints 3 -->
 +```
 +
 +### Example 2: Comparing Numbers
 +
 +```go-html-template
 +{{ lt 1 2 }}
 +<!-- prints true (i.e., since 1 is less than 2) -->
 +```
 +
 +Note that both examples make use of Go Template's [math]][] functions.
 +
 +{{% note "Additional Boolean Operators" %}}
 +There are more boolean operators than those listed in the Hugo docs in the [Go Template documentation](https://golang.org/pkg/text/template/#hdr-Functions).
 +{{% /note %}}
 +
 +## Includes
 +
 +When including another template, you will need to pass it the data that it would
 +need to access.
 +
 +{{% note %}}
 +To pass along the current context, please remember to include a trailing **dot**.
 +{{% /note %}}
 +
 +The templates location will always be starting at the `layouts/` directory
 +within Hugo.
 +
 +### Partial
 +
 +The [`partial`][partials] function is used to include *partial* templates using
 +the syntax `{{ partial "<PATH>/<PARTIAL>.<EXTENSION>" . }}`.
 +
 +Example of including a `layouts/partials/header.html` partial:
 +
 +```go-html-template
 +{{ partial "header.html" . }}
 +```
 +
 +### Template
 +
 +The `template` function was used to include *partial* templates
 +in much older Hugo versions. Now it's useful only for calling
 +[*internal* templates][internal templates]. The syntax is `{{ template
 +"_internal/<TEMPLATE>.<EXTENSION>" . }}`.
 +
 +{{% note %}}
 +The available **internal** templates can be found
 +[here](https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates).
 +{{% /note %}}
 +
 +Example of including the internal `opengraph.html` template:
 +
 +```go-html-template
 +{{ template "_internal/opengraph.html" . }}
 +```
 +
 +## Logic
 +
 +Go Templates provide the most basic iteration and conditional logic.
 +
 +### Iteration
 +
 +The Go Templates make heavy use of `range` to iterate over a _map_,
 +_array_, or _slice_. The following are different examples of how to
 +use `range`.
 +
 +#### Example 1: Using Context (`.`)
 +
 +```go-html-template
 +{{ range $array }}
 +    {{ . }} <!-- The . represents an element in $array -->
 +{{ end }}
 +```
 +
 +#### Example 2: Declaring a variable name for an array element's value
 +
 +```go-html-template
 +{{ range $elem_val := $array }}
 +    {{ $elem_val }}
 +{{ end }}
 +```
 +
 +#### Example 3: Declaring variable names for an array element's index _and_ value
 +
 +For an array or slice, the first declared variable will map to each
 +element's index.
 +
 +```go-html-template
 +{{ range $elem_index, $elem_val := $array }}
 +   {{ $elem_index }} -- {{ $elem_val }}
 +{{ end }}
 +```
 +
 +#### Example 4: Declaring variable names for a map element's key _and_ value
 +
 +For a map, the first declared variable will map to each map element's
 +key.
 +
 +```go-html-template
 +{{ range $elem_key, $elem_val := $map }}
 +   {{ $elem_key }} -- {{ $elem_val }}
 +{{ end }}
 +```
 +
 +#### Example 5: Conditional on empty _map_, _array_, or _slice_.
 +
 +If the _map_, _array_, or _slice_ passed into the range is zero-length then the else statement is evaluated.
 +
 +```go-html-template
 +{{ range $array }}
 +    {{ . }}
 +{{else}}
 +    <!-- This is only evaluated if $array is empty -->
 +{{ end }}
 +```
 +
 +### Conditionals
 +
 +`if`, `else`, `with`, `or`, `and` and `not` provide the framework for handling conditional logic in Go Templates. Like `range`, `if` and `with` statements are closed with an `{{ end }}`.
 +
 +Go Templates treat the following values as **false**:
 +
 +- `false` (boolean)
 +- 0 (integer)
 +- any zero-length array, slice, map, or string
 +
 +#### Example 1: `with`
 +
 +It is common to write "if something exists, do this" kind of
 +statements using `with`.
 +
 +{{% note %}}
 +`with` rebinds the context `.` within its scope (just like in `range`).
 +{{% /note %}}
 +
 +It skips the block if the variable is absent, or if it evaluates to
 +"false" as explained above.
 +
 +```go-html-template
 +{{ with .Params.title }}
 +    <h4>{{ . }}</h4>
 +{{ end }}
 +```
 +
 +#### Example 2: `with` .. `else`
 +
 +Below snippet uses the "description" front-matter parameter's value if
 +set, else uses the default `.Summary` [Page variable][pagevars]:
 +
 +
 +```go-html-template
 +{{ with .Param "description" }}
 +    {{ . }}
 +{{ else }}
 +    {{ .Summary }}
 +{{ end }}
 +```
 +
 +See the [`.Param` function][param].
 +
 +#### Example 3: `if`
 +
 +An alternative (and a more verbose) way of writing `with` is using
 +`if`. Here, the `.` does not get rebinded.
 +
 +Below example is "Example 1" rewritten using `if`:
 +
 +```go-html-template
 +{{ if isset .Params "title" }}
 +    <h4>{{ index .Params "title" }}</h4>
 +{{ end }}
 +```
 +
 +#### Example 4: `if` .. `else`
 +
 +Below example is "Example 2" rewritten using `if` .. `else`, and using
 +[`isset` function][isset] + `.Params` variable (different from the
 +[`.Param` **function**][param]) instead:
 +
 +```go-html-template
 +{{ if (isset .Params "description") }}
 +    {{ index .Params "description" }}
 +{{ else }}
 +    {{ .Summary }}
 +{{ end }}
 +```
 +
 +#### Example 5: `if` .. `else if` .. `else`
 +
 +Unlike `with`, `if` can contain `else if` clauses too.
 +
 +```go-html-template
 +{{ if (isset .Params "description") }}
 +    {{ index .Params "description" }}
 +{{ else if (isset .Params "summary") }}
 +    {{ index .Params "summary" }}
 +{{ else }}
 +    {{ .Summary }}
 +{{ end }}
 +```
 +
 +#### Example 6: `and` & `or`
 +
 +```go-html-template
 +{{ if (and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")) }}
 +```
 +
 +## Pipes
 +
 +One of the most powerful components of Go Templates is the ability to stack actions one after another. This is done by using pipes. Borrowed from Unix pipes, the concept is simple: each pipeline's output becomes the input of the following pipe.
 +
 +Because of the very simple syntax of Go Templates, the pipe is essential to being able to chain together function calls. One limitation of the pipes is that they can only work with a single value and that value becomes the last parameter of the next pipeline.
 +
 +A few simple examples should help convey how to use the pipe.
 +
 +### Example 1: `shuffle`
 +
 +The following two examples are functionally the same:
 +
 +```go-html-template
 +{{ shuffle (seq 1 5) }}
 +```
 +
 +
 +```go-html-template
 +{{ (seq 1 5) | shuffle }}
 +```
 +
 +### Example 2: `index`
 +
 +The following accesses the page parameter called "disqus_url" and escapes the HTML. This example also uses the [`index` function](/functions/index-function/), which is built into Go Templates:
 +
 +```go-html-template
 +{{ index .Params "disqus_url" | html }}
 +```
 +
 +### Example 3: `or` with `isset`
 +
 +```go-html-template
 +{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr") }}
 +Stuff Here
 +{{ end }}
 +```
 +
 +Could be rewritten as
 +
 +```go-html-template
 +{{ if isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" }}
 +Stuff Here
 +{{ end }}
 +```
 +
 +### Example 4: Internet Explorer Conditional Comments {#ie-conditional-comments}
 +
 +By default, Go Templates remove HTML comments from output. This has the unfortunate side effect of removing Internet Explorer conditional comments. As a workaround, use something like this:
 +
 +```go-html-template
 +{{ "<!--[if lt IE 9]>" | safeHTML }}
 +  <script src="html5shiv.js"></script>
 +{{ "<![endif]-->" | safeHTML }}
 +```
 +
 +Alternatively, you can use the backtick (`` ` ``) to quote the IE conditional comments, avoiding the tedious task of escaping every double quotes (`"`) inside, as demonstrated in the [examples](https://golang.org/pkg/text/template/#hdr-Examples) in the Go text/template documentation:
 +
 +```go-html-template
 +{{ `<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"><![endif]-->` | safeHTML }}
 +```
 +
 +## Context (aka "the dot") {#the-dot}
 +
 +The most easily overlooked concept to understand about Go Templates is
 +that `{{ . }}` always refers to the **current context**.
 +
 +- In the top level of your template, this will be the data set made
 +  available to it.
 +- Inside of an iteration, however, it will have the value of the
 +  current item in the loop; i.e., `{{ . }}` will no longer refer to
 +  the data available to the entire page.
 +
 +If you need to access page-level data (e.g., page params set in front
 +matter) from within the loop, you will likely want to do one of the
 +following:
 +
 +### 1. Define a Variable Independent of Context
 +
 +The following shows how to define a variable independent of the context.
 +
 +{{< code file="tags-range-with-page-variable.html" >}}
 +{{ $title := .Site.Title }}
 +<ul>
 +{{ range .Params.tags }}
 +    <li>
 +        <a href="/tags/{{ . | urlize }}">{{ . }}</a>
 +        - {{ $title }}
 +    </li>
 +{{ end }}
 +</ul>
 +{{< /code >}}
 +
 +{{% note %}}
 +Notice how once we have entered the loop (i.e. `range`), the value of `{{ . }}` has changed. We have defined a variable outside of the loop (`{{$title}}`) that we've assigned a value so that we have access to the value from within the loop as well.
 +{{% /note %}}
 +
 +### 2. Use `$.` to Access the Global Context
 +
 +`$` has special significance in your templates. `$` is set to the starting value of `.` ("the dot") by default. This is a [documented feature of Go text/template][dotdoc]. This means you have access to the global context from anywhere. Here is an equivalent example of the preceding code block but now using `$` to grab `.Site.Title` from the global context:
 +
 +{{< code file="range-through-tags-w-global.html" >}}
 +<ul>
 +{{ range .Params.tags }}
 +  <li>
 +    <a href="/tags/{{ . | urlize }}">{{ . }}</a>
 +            - {{ $.Site.Title }}
 +  </li>
 +{{ end }}
 +</ul>
 +{{< /code >}}
 +
 +{{% warning "Don't Redefine the Dot" %}}
 +The built-in magic of `$` would cease to work if someone were to mischievously redefine the special character; e.g. `{{ $ := .Site }}`. *Don't do it.* You may, of course, recover from this mischief by using `{{ $ := . }}` in a global context to reset `$` to its default value.
 +{{% /warning %}}
 +
 +## Whitespace
 +
 +Go 1.6 includes the ability to trim the whitespace from either side of a Go tag by including a hyphen (`-`) and space immediately beside the corresponding `{{` or `}}` delimiter.
 +
 +For instance, the following Go Template will include the newlines and horizontal tab in its HTML output:
 +
 +```go-html-template
 +<div>
 +  {{ .Title }}
 +</div>
 +```
 +
 +Which will output:
 +
 +```html
 +<div>
 +  Hello, World!
 +</div>
 +```
 +
 +Leveraging the `-` in the following example will remove the extra white space surrounding the `.Title` variable and remove the newline:
 +
 +```go-html-template
 +<div>
 +  {{- .Title -}}
 +</div>
 +```
 +
 +Which then outputs:
 +
 +```html
 +<div>Hello, World!</div>
 +```
 +
 +Go considers the following characters _whitespace_:
 +
 +* <kbd>space</kbd>
 +* horizontal <kbd>tab</kbd>
 +* carriage <kbd>return</kbd>
 +* newline
 +
 +## Comments
 +
 +In order to keep your templates organized and share information throughout your team, you may want to add comments to your templates. There are two ways to do that with Hugo.
 +
 +### Go Templates comments
 +
 +Go Templates support `{{/*` and `*/}}` to open and close a comment block. Nothing within that block will be rendered.
 +
 +For example:
 +
 +```go-html-template
 +Bonsoir, {{/* {{ add 0 + 2 }} */}}Eliott.
 +```
 +
 +Will render `Bonsoir, Eliott.`, and not care about the syntax error (`add 0 + 2`) in the comment block.
 +
 +### HTML comments
 +
 +If you need to produce HTML comments from your templates, take a look at the [Internet Explorer conditional comments](#ie-conditional-comments) example. If you need variables to construct such HTML comments, just pipe `printf` to `safeHTML`. For example:
 +
 +```go-html-template
 +{{ printf "<!-- Our website is named: %s -->" .Site.Title | safeHTML }}
 +```
 +
 +#### HTML comments containing Go Templates
 +
 +HTML comments are by default stripped, but their content is still evaluated. That means that although the HTML comment will never render any content to the final HTML pages, code contained within the comment may fail the build process.
 +
 +{{% note %}}
 +Do **not** try to comment out Go Template code using HTML comments.
 +{{% /note %}}
 +
 +```go-html-template
 +<!-- {{ $author := "Emma Goldman" }} was a great woman. -->
 +{{ $author }}
 +```
 +
 +The templating engine will strip the content within the HTML comment, but will first evaluate any Go Template code if present within. So the above example will render `Emma Goldman`, as the `$author` variable got evaluated in the HTML comment. But the build would have failed if that code in the HTML comment had an error.
 +
 +## Hugo Parameters
 +
 +Hugo provides the option of passing values to your template layer through your [site configuration][config] (i.e. for site-wide values) or through the metadata of each specific piece of content (i.e. the [front matter][]). You can define any values of any type and use them however you want in your templates, as long as the values are supported by the [front matter format]({{< ref "front-matter.md#front-matter-formats" >}}).
 +
 +## Use Content (`Page`) Parameters
 +
 +You can provide variables to be used by templates in individual content's [front matter][].
 +
 +An example of this is used in the Hugo docs. Most of the pages benefit from having the table of contents provided, but sometimes the table of contents doesn't make a lot of sense. We've defined a `notoc` variable in our front matter that will prevent a table of contents from rendering when specifically set to `true`.
 +
 +Here is the example front matter (YAML):
 +
 +```
 +---
 +title: Roadmap
 +lastmod: 2017-03-05
 +date: 2013-11-18
 +notoc: true
 +---
 +```
 +
 +Here is an example of corresponding code that could be used inside a `toc.html` [partial template][partials]:
 +
 +{{< code file="layouts/partials/toc.html" download="toc.html" >}}
 +{{ if not .Params.notoc }}
 +<aside>
 +  <header>
 +    <a href="#{{.Title | urlize}}">
 +    <h3>{{.Title}}</h3>
 +    </a>
 +  </header>
 +  {{.TableOfContents}}
 +</aside>
 +<a href="#" id="toc-toggle"></a>
 +{{ end }}
 +{{< /code >}}
 +
 +We want the *default* behavior to be for pages to include a TOC unless otherwise specified. This template checks to make sure that the `notoc:` field in this page's front matter is not `true`.
 +
 +## Use Site Configuration Parameters
 +
 +You can arbitrarily define as many site-level parameters as you want in your [site's configuration file][config]. These parameters are globally available in your templates.
 +
 +For instance, you might declare the following:
 +
 +{{< code-toggle file="config" >}}
 +params:
 +  copyrighthtml: "Copyright &#xA9; 2017 John Doe. All Rights Reserved."
 +  twitteruser: "spf13"
 +  sidebarrecentlimit: 5
 +{{< /code >}}
 +
 +Within a footer layout, you might then declare a `<footer>` that is only rendered if the `copyrighthtml` parameter is provided. If it *is* provided, you will then need to declare the string is safe to use via the [`safeHTML` function][safehtml] so that the HTML entity is not escaped again. This would let you easily update just your top-level config file each January 1st, instead of hunting through your templates.
 +
 +```go-html-template
 +{{ if .Site.Params.copyrighthtml }}
 +    <footer>
 +        <div class="text-center">{{.Site.Params.CopyrightHTML | safeHTML}}</div>
 +    </footer>
 +{{ end }}
 +```
 +
 +An alternative way of writing the "`if`" and then referencing the same value is to use [`with`][with] instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent:
 +
 +{{< code file="layouts/partials/twitter.html" >}}
 +{{ with .Site.Params.twitteruser }}
 +    <div>
 +        <a href="https://twitter.com/{{.}}" rel="author">
 +        <img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}" alt="Twitter"></a>
 +    </div>
 +{{ end }}
 +{{< /code >}}
 +
 +Finally, you can pull "magic constants" out of your layouts as well. The following uses the [`first`][first] function, as well as the [`.RelPermalink`][relpermalink] page variable and the [`.Site.Pages`][sitevars] site variable.
 +
 +```go-html-template
 +<nav>
 +  <h1>Recent Posts</h1>
 +  <ul>
 +  {{- range first .Site.Params.SidebarRecentLimit .Site.Pages -}}
 +      <li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
 +  {{- end -}}
 +  </ul>
 +</nav>
 +```
 +
 +## Example: Show Future Events
 +
 +Given the following content structure and [front matter]:
 +
 +```text
 +content/
 +└── events/
 +    ├── event-1.md
 +    ├── event-2.md
 +    └── event-3.md
 +```
 +
 +{{< code-toggle file="content/events/event-1.md" copy="false" >}}
 +title = 'Event 1'
 +date = 2021-12-06T10:37:16-08:00
 +draft = false
 +start_date = 2021-12-05T09:00:00-08:00
 +end_date = 2021-12-05T11:00:00-08:00
 +{{< /code-toggle >}}
 +
 +This [partial template][partials] renders future events:
 +
 +{{< code file="layouts/partials/future-events.html" >}}
 +<h2>Future Events</h2>
 +<ul>
 +  {{ range where site.RegularPages "Type" "events" }}
 +    {{ if gt (.Params.start_date | time.AsTime) now }}
 +      {{ $startDate := .Params.start_date | time.Format ":date_medium" }}
 +      <li>
 +        <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> - {{ $startDate }}
 +      </li>
 +    {{ end }}
 +  {{ end }}
 +</ul>
 +{{< /code >}}
 +
 +If you restrict front matter to the TOML format, and omit quotation marks surrounding date fields, you can perform date comparisons without casting.
 +
 +{{< code file="layouts/partials/future-events.html" >}}
 +<h2>Future Events</h2>
 +<ul>
 +  {{ range where (where site.RegularPages "Type" "events") "Params.start_date" "gt" now }}
 +    {{ $startDate := .Params.start_date | time.Format ":date_medium" }}
 +    <li>
 +      <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> - {{ $startDate }}
 +    </li>
 +  {{ end }}
 +</ul>
 +{{< /code >}}
 +
 +[config]: {{< relref "getting-started/configuration" >}}
 +[dotdoc]: https://golang.org/pkg/text/template/#hdr-Variables
 +[first]: {{< relref "functions/first" >}}
 +[front matter]: {{< relref "content-management/front-matter" >}}
 +[functions]: {{< relref "functions" >}}
 +[internal templates]: {{< relref "templates/internal" >}}
 +[isset]: {{< relref "functions/isset" >}}
 +[math]: {{< relref "functions/math" >}}
 +[pagevars]: {{< relref "variables/page" >}}
 +[param]: {{< relref "functions/param" >}}
 +[partials]: {{< relref "templates/partials" >}}
 +[relpermalink]: {{< relref "variables/page#page-variables" >}}
 +[safehtml]: {{< relref "functions/safehtml" >}}
 +[sitevars]: {{< relref "variables/site" >}}
 +[variables]: {{< relref "variables" >}}
 +[with]: {{< relref "functions/with" >}}
index 0662c4f60d7fc02fab4efdda38f77829c1ddd531,0000000000000000000000000000000000000000..bd0c7b34b94333e37d763c86191a6c18b05c8011
mode 100644,000000..100644
--- /dev/null
@@@ -1,35 -1,0 +1,35 @@@
- HUGO_VERSION = "0.98.0"
 +[build]
 +publish = "public"
 +command = "hugo --gc --minify"
 +
 +[context.production.environment]
- HUGO_VERSION = "0.98.0"
++HUGO_VERSION = "0.99.1"
 +HUGO_ENV = "production"
 +HUGO_ENABLEGITINFO = "true"
 +
 +[context.split1]
 +command = "hugo --gc --minify --enableGitInfo"
 +
 +[context.split1.environment]
- HUGO_VERSION = "0.98.0"
++HUGO_VERSION = "0.99.1"
 +HUGO_ENV = "production"
 +
 +[context.deploy-preview]
 +command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
 +
 +[context.deploy-preview.environment]
- HUGO_VERSION = "0.98.0"
++HUGO_VERSION = "0.99.1"
 +
 +[context.branch-deploy]
 +command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
 +
 +[context.branch-deploy.environment]
++HUGO_VERSION = "0.99.1"
 +
 +[context.next.environment]
 +HUGO_ENABLEGITINFO = "true"
 +
 +[[redirects]]
 +from = "/npmjs/*"
 +to = "/npmjs/"
 +status = 200