--- /dev/null
- trace.out
+/.idea
+/public
+node_modules
+nohup.out
+.DS_Store
++trace.out
++.hugo_build.lock
--- /dev/null
- godocref: ""
+---
+linktitle: ""
+description: ""
- ---
+publishdate: ""
+lastmod: ""
+categories: []
+tags: []
+weight: 00
+slug: ""
+aliases: []
+toc: false
++---
--- /dev/null
- godocref: ""
+---
+linktitle: ""
+description: ""
- ---
+publishdate: ""
+lastmod: ""
+categories: [functions]
+tags: []
+ns: ""
+signature: []
+workson: []
+hugoversion: ""
+aliases: []
+relatedfuncs: []
+toc: false
+deprecated: false
++---
--- /dev/null
- ## Comments Alternatives
+---
+title: Comments
+linktitle: Comments
+description: Hugo ships with an internal Disqus template, but this isn't the only commenting system that will work with your new Hugo website.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-03-09
+keywords: [sections,content,organization]
+categories: [project organization, fundamentals]
+menu:
+ docs:
+ parent: "content-management"
+ weight: 140
+weight: 140 #rem
+draft: false
+aliases: [/extras/comments/]
+toc: true
+---
+
+Hugo ships with support for [Disqus](https://disqus.com/), a third-party service that provides comment and community capabilities to websites via JavaScript.
+
+Your theme may already support Disqus, but if not, it is easy to add to your templates via [Hugo's built-in Disqus partial][disquspartial].
+
+## Add Disqus
+
+Hugo comes with all the code you need to load Disqus into your templates. Before adding Disqus to your site, you'll need to [set up an account][disqussetup].
+
+### Configure Disqus
+
+Disqus comments require you set a single value in your [site's configuration file][configuration] like so:
+
+{{< code-toggle copy="false" >}}
+disqusShortname = "yourdiscussshortname"
+{{</ code-toggle >}}
+
+For many websites, this is enough configuration. However, you also have the option to set the following in the [front matter][] of a single content file:
+
+* `disqus_identifier`
+* `disqus_title`
+* `disqus_url`
+
+### Render Hugo's Built-in Disqus Partial Template
+
+Disqus has its own [internal template](https://gohugo.io/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
+
+```
+{{ template "_internal/disqus.html" . }}
+```
+
- There are a few alternatives to commenting on static sites for those who do not want to use Disqus:
++## Alternatives
+
- * [Staticman](https://staticman.net/)
- * [Talkyard](https://www.talkyard.io/blog-comments) (Open source, & serverless hosting)
++These are some alternatives to Disqus:
+
- * [Graph Comment][]
++* [Cactus Comments](https://cactus.chat/docs/integrations/hugo/) (Open Source, Matrix appservice, Docker install)
++* [Commento](https://commento.io/) (Open Source, available as a service, local install, or docker image)
++* [Graph Comment](https://graphcomment.com/)
++* [Hyvor Talk](https://talk.hyvor.com/) (Available as a service)
+* [IntenseDebate](https://intensedebate.com/)
- * [Isso](https://posativ.org/isso/) (Self-hosted, Python)
- * [Tutorial on Implementing Isso with Hugo][issotutorial]
++* [Isso](https://posativ.org/isso/) (Self-hosted, Python) ([tutorial][issotutorial])
+* [Muut](https://muut.com/)
- * [Remark](https://github.com/umputun/remark) (Open source, Golang, Easy to run docker)
- * [Commento](https://commento.io/) (Open Source, available as a service, local install, or docker image)
- * [Hyvor Talk](https://talk.hyvor.com/) (Available as a service)
-
++* [Remark42](https://remark42.com/) (Open source, Golang, Easy to run docker)
++* [Staticman](https://staticman.net/)
++* [Talkyard](https://www.talkyard.io/blog-comments) (Open source, & serverless hosting)
+* [Utterances](https://utteranc.es/) (Open source, GitHub comments widget built on GitHub issues)
- [Graph Comment]: https://graphcomment.com/
+
+[configuration]: /getting-started/configuration/
+[disquspartial]: /templates/partials/#disqus
+[disqussetup]: https://disqus.com/profile/signup/
+[forum]: https://discourse.gohugo.io
+[front matter]: /content-management/front-matter/
+[kaijuissue]: https://github.com/spf13/kaiju/issues/new
+[issotutorial]: https://stiobhart.net/2017-02-24-isso-comments/
+[partials]: /templates/partials/
+[MongoDB]: https://www.mongodb.com/
+[tweet]: https://twitter.com/spf13
--- /dev/null
- : A Glob pattern matching the Page's Kind(s), e.g. "{home,section}".
+---
+title: Front Matter
+linktitle:
+description: Hugo allows you to add front matter in yaml, toml, or json to your content files.
+date: 2017-01-09
+publishdate: 2017-01-09
+lastmod: 2017-02-24
+categories: [content management]
+keywords: ["front matter", "yaml", "toml", "json", "metadata", "archetypes"]
+menu:
+ docs:
+ parent: "content-management"
+ weight: 30
+weight: 30 #rem
+draft: false
+aliases: [/content/front-matter/]
+toc: true
+---
+
+**Front matter** allows you to keep metadata attached to an instance of a [content type][]---i.e., embedded inside a content file---and is one of the many features that gives Hugo its strength.
+
+{{< youtube Yh2xKRJGff4 >}}
+
+## Front Matter Formats
+
+Hugo supports four formats for front matter, each with their own identifying tokens.
+
+TOML
+: identified by opening and closing `+++`.
+
+YAML
+: identified by opening and closing `---`.
+
+JSON
+: a single JSON object surrounded by '`{`' and '`}`', followed by a new line.
+
+ORG
+: a group of Org mode keywords in the format '`#+KEY: VALUE`'. Any line that does not start with `#+` ends the front matter section.
+ Keyword values can be either strings (`#+KEY: VALUE`) or a whitespace separated list of strings (`#+KEY[]: VALUE_1 VALUE_2`).
+
+### Example
+
+{{< code-toggle >}}
+title = "spf13-vim 3.0 release and new website"
+description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
+tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ]
+date = "2012-04-06"
+categories = [
+ "Development",
+ "VIM"
+]
+slug = "spf13-vim-3-0-release-and-new-website"
+{{< /code-toggle >}}
+
+## Front Matter Variables
+
+### Predefined
+
+There are a few predefined variables that Hugo is aware of. See [Page Variables][pagevars] for how to call many of these predefined variables in your templates.
+
+aliases
+: an array of one or more aliases (e.g., old published paths of renamed content) that will be created in the output directory structure . See [Aliases][aliases] for details.
+
+audio
+: an array of paths to audio files related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:audio`.
+
+cascade
+: a map of Front Matter keys whose values are passed down to the page's descendents unless overwritten by self or a closer ancestor's cascade. See [Front Matter Cascade](#front-matter-cascade) for details.
+
+date
+: the datetime assigned to this page. This is usually fetched from the `date` field in front matter, but this behaviour is configurable.
+
+description
+: the description for the content.
+
+draft
+: if `true`, the content will not be rendered unless the `--buildDrafts` flag is passed to the `hugo` command.
+
+expiryDate
+: the datetime at which the content should no longer be published by Hugo; expired content will not be rendered unless the `--buildExpired` flag is passed to the `hugo` command.
+
+headless
+: if `true`, sets a leaf bundle to be [headless][headless-bundle].
+
+images
+: an array of paths to images related to the page; used by [internal templates](/templates/internal) such as `_internal/twitter_cards.html`.
+
+isCJKLanguage
+: if `true`, Hugo will explicitly treat the content as a CJK language; both `.Summary` and `.WordCount` work properly in CJK languages.
+
+keywords
+: the meta keywords for the content.
+
+layout
+: the layout Hugo should select from the [lookup order][lookup] when rendering the content. If a `type` is not specified in the front matter, Hugo will look for the layout of the same name in the layout directory that corresponds with a content's section. See ["Defining a Content Type"][definetype]
+
+lastmod
+: the datetime at which the content was last modified.
+
+linkTitle
+: used for creating links to content; if set, Hugo defaults to using the `linktitle` before the `title`. Hugo can also [order lists of content by `linktitle`][bylinktitle].
+
+markup
+: **experimental**; specify `"rst"` for reStructuredText (requires`rst2html`) or `"md"` (default) for Markdown.
+
+outputs
+: allows you to specify output formats specific to the content. See [output formats][outputs].
+
+publishDate
+: if in the future, content will not be rendered unless the `--buildFuture` flag is passed to `hugo`.
+
+resources
+: used for configuring page bundle resources. See [Page Resources][page-resources].
+
+series
+: an array of series this page belongs to, as a subset of the `series` [taxonomy](/content-management/taxonomies/); used by the `opengraph` [internal template](/templates/internal) to populate `og:see_also`.
+
+slug
+: appears as the tail of the output URL. A value specified in front matter will override the segment of the URL based on the filename.
+
+summary
+: text used when providing a summary of the article in the `.Summary` page variable; details available in the [content-summaries](/content-management/summaries/) section.
+
+title
+: the title for the content.
+
+type
+: the type of the content; this value will be automatically derived from the directory (i.e., the [section][]) if not specified in front matter.
+
+url
+: the full path to the content from the web root. It makes no assumptions about the path of the content file. It also ignores any language prefixes of
+the multilingual feature.
+
+videos
+: an array of paths to videos related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:video`.
+
+weight
+: used for [ordering your content in lists][ordering]. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an *unset* weight.
+
+\<taxonomies\>
+: field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. _Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables._
+
+{{% note "Hugo's Default URL Destinations" %}}
+If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site `config` file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
+{{% /note %}}
+
+### User-Defined
+
+You can add fields to your front matter arbitrarily to meet your needs. These user-defined key-values are placed into a single `.Params` variable for use in your templates.
+
+The following fields can be accessed via `.Params.include_toc` and `.Params.show_comments`, respectively. The [Variables][] section provides more information on using Hugo's page- and site-level variables in your templates.
+
+{{< code-toggle copy="false" >}}
+include_toc: true
+show_comments: false
+{{</ code-toggle >}}
+
+## Front Matter Cascade
+
+Any node or section can pass down to descendents a set of Front Matter values as long as defined underneath the reserved `cascade` Front Matter key.
+
+### Target Specific Pages
+
+{{< new-in "0.76.0" >}}
+
+Since Hugo 0.76 the `cascade` block can be a slice with a optional `_target` keyword, allowing for multiple `cascade` values targeting different page sets.
+
+{{< code-toggle copy="false" >}}
+title ="Blog"
+[[cascade]]
+background = "yosemite.jpg"
+[cascade._target]
+path="/blog/**"
+lang="en"
+kind="page"
+[[cascade]]
+background = "goldenbridge.jpg"
+[cascade._target]
+kind="section"
+{{</ code-toggle >}}
+
+Keywords available for `_target`:
+
+path
+: A [Glob](https://github.com/gobwas/glob) pattern matching the content path below /content. Expects Unix-styled slashes. Note that this is the virtual path, so it starts at the mount root. The matching support double-asterisks so you can match for patterns like `/blog/*/**` to match anything from the third level and down.
+
+kind
++: The Page's Kind, e.g. "section".
+
+lang
+: A Glob pattern matching the Page's language, e.g. "{en,sv}".
+
+Any of the above can be omitted.
+
+### Example
+
+In `content/blog/_index.md`
+
+{{< code-toggle copy="false" >}}
+title: Blog
+cascade:
+ banner: images/typewriter.jpg
+{{</ code-toggle >}}
+
+With the above example the Blog section page and its descendents will return `images/typewriter.jpg` when `.Params.banner` is invoked unless:
+
+- Said descendent has its own `banner` value set
+- Or a closer ancestor node has its own `cascade.banner` value set.
+
+
+
+## Order Content Through Front Matter
+
+You can assign content-specific `weight` in the front matter of your content. These values are especially useful for [ordering][ordering] in list views. You can use `weight` for ordering of content and the convention of [`<TAXONOMY>_weight`][taxweight] for ordering content within a taxonomy. See [Ordering and Grouping Hugo Lists][lists] to see how `weight` can be used to organize your content in list views.
+
+## Override Global Markdown Configuration
+
+It's possible to set some options for Markdown rendering in a content's front matter as an override to the [BlackFriday rendering options set in your project configuration][config].
+
+## Front Matter Format Specs
+
+* [TOML Spec][toml]
+* [YAML Spec][yaml]
+* [JSON Spec][json]
+
+[variables]: /variables/
+[aliases]: /content-management/urls/#aliases
+[archetype]: /content-management/archetypes/
+[bylinktitle]: /templates/lists/#by-link-title
+[config]: /getting-started/configuration/ "Hugo documentation for site configuration"
+[content type]: /content-management/types/
+[contentorg]: /content-management/organization/
+[definetype]: /content-management/types/#defining-a-content-type "Learn how to specify a type and a layout in a content's front matter"
+[headless-bundle]: /content-management/page-bundles/#headless-bundle
+[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
+[lists]: /templates/lists/#ordering-content "See how to order content in list pages; for example, templates that look to specific _index.md for content and front matter."
+[lookup]: /templates/lookup-order/ "Hugo traverses your templates in a specific order when rendering content to allow for DRYer templating."
+[ordering]: /templates/lists/ "Hugo provides multiple ways to sort and order your content in list templates"
+[outputs]: /templates/output-formats/ "With the release of v22, you can output your content to any text format using Hugo's familiar templating"
+[page-resources]: /content-management/page-resources/
+[pagevars]: /variables/page/
+[section]: /content-management/sections/
+[taxweight]: /content-management/taxonomies/
+[toml]: https://github.com/toml-lang/toml "Specification for TOML, Tom's Obvious Minimal Language"
+[urls]: /content-management/urls/
+[variables]: /variables/
+[yaml]: https://yaml.org/spec/ "Specification for YAML, YAML Ain't Markup Language"
--- /dev/null
- godocref:
+---
+title: Shortcodes
+linktitle:
+description: Shortcodes are simple snippets inside your content files calling built-in or custom templates.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2019-11-07
+menu:
+ docs:
+ parent: "content-management"
+ weight: 35
+weight: 35 #rem
+categories: [content management]
+keywords: [markdown,content,shortcodes]
+draft: false
+aliases: [/extras/shortcodes/]
+testparam: "Hugo Rocks!"
+toc: true
+---
+
+## What a Shortcode is
+
+Hugo loves Markdown because of its simple content format, but there are times when Markdown falls short. Often, content authors are forced to add raw HTML (e.g., video `<iframe>`'s) to Markdown content. We think this contradicts the beautiful simplicity of Markdown's syntax.
+
+Hugo created **shortcodes** to circumvent these limitations.
+
+A shortcode is a simple snippet inside a content file that Hugo will render using a predefined template. Note that shortcodes will not work in template files. If you need the type of drop-in functionality that shortcodes provide but in a template, you most likely want a [partial template][partials] instead.
+
+In addition to cleaner Markdown, shortcodes can be updated any time to reflect new classes, techniques, or standards. At the point of site generation, Hugo shortcodes will easily merge in your changes. You avoid a possibly complicated search and replace operation.
+
+## Use Shortcodes
+
+{{< youtube 2xkNJL4gJ9E >}}
+
+In your content files, a shortcode can be called by calling `{{%/* shortcodename parameters */%}}`. Shortcode parameters are space delimited, and parameters with internal spaces can be quoted.
+
+The first word in the shortcode declaration is always the name of the shortcode. Parameters follow the name. Depending upon how the shortcode is defined, the parameters may be named, positional, or both, although you can't mix parameter types in a single call. The format for named parameters models that of HTML with the format `name="value"`.
+
+Some shortcodes use or require closing shortcodes. Again like HTML, the opening and closing shortcodes match (name only) with the closing declaration, which is prepended with a slash.
+
+Here are two examples of paired shortcodes:
+
+```
+{{%/* mdshortcode */%}}Stuff to `process` in the *center*.{{%/* /mdshortcode */%}}
+```
+
+```
+{{</* highlight go */>}} A bunch of code here {{</* /highlight */>}}
+```
+
+The examples above use two different delimiters, the difference being the `%` character in the first and the `<>` characters in the second.
+
+### Shortcodes with raw string parameters
+
+{{< new-in "0.64.1" >}}
+
+You can pass multiple lines as parameters to a shortcode by using raw string literals:
+
+```
+{{</* myshortcode `This is some <b>HTML</b>,
+and a new line with a "quoted string".` */>}}
+```
+
+### Shortcodes with Markdown
+
+In Hugo `0.55` we changed how the `%` delimiter works. Shortcodes using the `%` as the outer-most delimiter will now be fully rendered when sent to the content renderer. They can be part of the generated table of contents, footnotes, etc.
+
+If you want the old behavior, you can put the following line in the start of your shortcode template:
+
+```
+{{ $_hugo_config := `{ "version": 1 }` }}
+```
+
+
+### Shortcodes Without Markdown
+
+The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without markdown include internal HTML:
+
+```
+{{</* myshortcode */>}}<p>Hello <strong>World!</strong></p>{{</* /myshortcode */>}}
+```
+
+### Nested Shortcodes
+
+You can call shortcodes within other shortcodes by creating your own templates that leverage the `.Parent` variable. `.Parent` allows you to check the context in which the shortcode is being called. See [Shortcode templates][sctemps].
+
+## Use Hugo's Built-in Shortcodes
+
+Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your markdown content clean.
+
+### `figure`
+
+`figure` is an extension of the image syntax in markdown, which does not provide a shorthand for the more semantic [HTML5 `<figure>` element][figureelement].
+
+The `figure` shortcode can use the following named parameters:
+
+src
+: URL of the image to be displayed.
+
+link
+: If the image needs to be hyperlinked, URL of the destination.
+
+target
+: Optional `target` attribute for the URL if `link` parameter is set.
+
+rel
+: Optional `rel` attribute for the URL if `link` parameter is set.
+
+alt
+: Alternate text for the image if the image cannot be displayed.
+
+title
+: Image title.
+
+caption
+: Image caption. Markdown within the value of `caption` will be rendered.
+
+class
+: `class` attribute of the HTML `figure` tag.
+
+height
+: `height` attribute of the image.
+
+width
+: `width` attribute of the image.
+
+attr
+: Image attribution text. Markdown within the value of `attr` will be rendered.
+
+attrlink
+: If the attribution text needs to be hyperlinked, URL of the destination.
+
+#### Example `figure` Input
+
+{{< code file="figure-input-example.md" >}}
+{{</* figure src="/media/spf13.jpg" title="Steve Francia" */>}}
+{{< /code >}}
+
+#### Example `figure` Output
+
+{{< output file="figure-output-example.html" >}}
+<figure>
+ <img src="/media/spf13.jpg" />
+ <figcaption>
+ <h4>Steve Francia</h4>
+ </figcaption>
+</figure>
+{{< /output >}}
+
+### `gist`
+
+Bloggers often want to include GitHub gists when writing posts. Let's suppose we want to use the [gist at the following url][examplegist]:
+
+```
+https://gist.github.com/spf13/7896402
+```
+
+We can embed the gist in our content via username and gist ID pulled from the URL:
+
+```
+{{</* gist spf13 7896402 */>}}
+```
+
+#### Example `gist` Input
+
+If the gist contains several files and you want to quote just one of them, you can pass the filename (quoted) as an optional third argument:
+
+{{< code file="gist-input.md" >}}
+{{</* gist spf13 7896402 "img.html" */>}}
+{{< /code >}}
+
+#### Example `gist` Output
+
+{{< output file="gist-output.html" >}}
+{{< gist spf13 7896402 >}}
+{{< /output >}}
+
+#### Example `gist` Display
+
+To demonstrate the remarkably efficiency of Hugo's shortcode feature, we have embedded the `spf13` `gist` example in this page. The following simulates the experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
+
+{{< gist spf13 7896402 >}}
+
+### `highlight`
+
+This shortcode will convert the source code provided into syntax-highlighted HTML. Read more on [highlighting](/tools/syntax-highlighting/). `highlight` takes exactly one required `language` parameter and requires a closing shortcode.
+
+#### Example `highlight` Input
+
+{{< code file="content/tutorials/learn-html.md" >}}
+{{</* highlight html */>}}
+<section id="main">
+ <div>
+ <h1 id="title">{{ .Title }}</h1>
+ {{ range .Pages }}
+ {{ .Render "summary"}}
+ {{ end }}
+ </div>
+</section>
+{{</* /highlight */>}}
+{{< /code >}}
+
+#### Example `highlight` Output
+
+The `highlight` shortcode example above would produce the following HTML when the site is rendered:
+
+{{< output file="tutorials/learn-html/index.html" >}}
+<span style="color: #f92672"><section</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"main"</span><span style="color: #f92672">></span>
+ <span style="color: #f92672"><div></span>
+ <span style="color: #f92672"><h1</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"title"</span><span style="color: #f92672">></span>{{ .Title }}<span style="color: #f92672"></h1></span>
+ {{ range .Pages }}
+ {{ .Render "summary"}}
+ {{ end }}
+ <span style="color: #f92672"></div></span>
+<span style="color: #f92672"></section></span>
+{{< /output >}}
+
+{{% note "More on Syntax Highlighting" %}}
+To see even more options for adding syntax-highlighted code blocks to your website, see [Syntax Highlighting in Developer Tools](/tools/syntax-highlighting/).
+{{% /note %}}
+
+### `instagram`
+
+If you'd like to embed a photo from [Instagram][], you only need the photo's ID. You can discern an Instagram photo ID from the URL:
+
+```
+https://www.instagram.com/p/BWNjjyYFxVx/
+```
+
+#### Example `instagram` Input
+
+{{< code file="instagram-input.md" >}}
+{{</* instagram BWNjjyYFxVx */>}}
+{{< /code >}}
+
+You also have the option to hide the caption:
+
+{{< code file="instagram-input-hide-caption.md" >}}
+{{</* instagram BWNjjyYFxVx hidecaption */>}}
+{{< /code >}}
+
+#### Example `instagram` Output
+
+By adding the preceding `hidecaption` example, the following HTML will be added to your rendered website's markup:
+
+{{< output file="instagram-hide-caption-output.html" >}}
+{{< instagram BWNjjyYFxVx hidecaption >}}
+{{< /output >}}
+
+#### Example `instagram` Display
+
+Using the preceding `instagram` with `hidecaption` example above, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
+
+{{< instagram BWNjjyYFxVx hidecaption >}}
+
+
+
+{{% note %}}
+The `instagram`-shortcode refers an endpoint of Instagram's API, that's deprecated since October 24th, 2020. Thus, no images can be fetched from this API endpoint, resulting in an error when the `instagram`-shortcode is used. For more information please have a look at GitHub issue [#7879](https://github.com/gohugoio/hugo/issues/7879).
+{{% /note %}}
+
+### `param`
+
+Gets a value from the current `Page's` params set in front matter, with a fall back to the site param value. It will log an `ERROR` if the param with the given key could not be found in either.
+
+```bash
+{{</* param testparam */>}}
+```
+
+Since `testparam` is a param defined in front matter of this page with the value `Hugo Rocks!`, the above will print:
+
+{{< param testparam >}}
+
+To access deeply nested params, use "dot syntax", e.g:
+
+```bash
+{{</* param "my.nested.param" */>}}
+```
+
+### `ref` and `relref`
+
+These shortcodes will look up the pages by their relative path (e.g., `blog/post.md`) or their logical name (`post.md`) and return the permalink (`ref`) or relative permalink (`relref`) for the found page.
+
+`ref` and `relref` also make it possible to make fragmentary links that work for the header links generated by Hugo.
+
+{{% note "More on Cross References" %}}
+Read a more extensive description of `ref` and `relref` in the [cross references](/content-management/cross-references/) documentation.
+{{% /note %}}
+
+`ref` and `relref` take exactly one required parameter of _reference_, quoted and in position `0`.
+
+#### Example `ref` and `relref` Input
+
+```
+[Neat]({{</* ref "blog/neat.md" */>}})
+[Who]({{</* relref "about.md#who" */>}})
+```
+
+#### Example `ref` and `relref` Output
+
+Assuming that standard Hugo pretty URLs are turned on.
+
+```
+<a href="https://example.com/blog/neat">Neat</a>
+<a href="/about/#who">Who</a>
+```
+
+### `tweet`
+
+You want to include a single tweet into your blog post? Everything you need is the URL of the tweet:
+
+```
+https://twitter.com/spf13/status/877500564405444608
+```
+
+#### Example `tweet` Input
+
+Pass the tweet's ID from the URL as a parameter to the `tweet` shortcode:
+
+{{< code file="example-tweet-input.md" >}}
+{{</* tweet 877500564405444608 */>}}
+{{< /code >}}
+
+#### Example `tweet` Output
+
+Using the preceding `tweet` example, the following HTML will be added to your rendered website's markup:
+
+{{< output file="example-tweet-output.html" >}}
+{{< tweet 877500564405444608 >}}
+{{< /output >}}
+
+#### Example `tweet` Display
+
+Using the preceding `tweet` example, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
+
+{{< tweet 877500564405444608 >}}
+
+### `vimeo`
+
+Adding a video from [Vimeo][] is equivalent to the [YouTube Input shortcode][].
+
+```
+https://vimeo.com/channels/staffpicks/146022717
+```
+
+#### Example `vimeo` Input
+
+Extract the ID from the video's URL and pass it to the `vimeo` shortcode:
+
+{{< code file="example-vimeo-input.md" >}}
+{{</* vimeo 146022717 */>}}
+{{< /code >}}
+
+#### Example `vimeo` Output
+
+Using the preceding `vimeo` example, the following HTML will be added to your rendered website's markup:
+
+{{< output file="example-vimeo-output.html" >}}
+{{< vimeo 146022717 >}}
+{{< /output >}}
+
+{{% tip %}}
+If you want to further customize the visual styling of the YouTube or Vimeo output, add a `class` named parameter when calling the shortcode. The new `class` will be added to the `<div>` that wraps the `<iframe>` *and* will remove the inline styles. Note that you will need to call the `id` as a named parameter as well. You can also give the vimeo video a descriptive title with `title`.
+
+```
+{{</* vimeo id="146022717" class="my-vimeo-wrapper-class" title="My vimeo video" */>}}
+```
+{{% /tip %}}
+
+#### Example `vimeo` Display
+
+Using the preceding `vimeo` example, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
+
+{{< vimeo 146022717 >}}
+
+### `youtube`
+
+The `youtube` shortcode embeds a responsive video player for [YouTube videos][]. Only the ID of the video is required, e.g.:
+
+```
+https://www.youtube.com/watch?v=w7Ft2ymGmfc
+```
+
+
+#### Example `youtube` Input
+
+Copy the YouTube video ID that follows `v=` in the video's URL and pass it to the `youtube` shortcode:
+
+{{< code file="example-youtube-input.md" >}}
+{{</* youtube w7Ft2ymGmfc */>}}
+{{< /code >}}
+
+Furthermore, you can automatically start playback of the embedded video by setting the `autoplay` parameter to `true`. Remember that you can't mix named and unnamed parameters, so you'll need to assign the yet unnamed video id to the parameter `id`:
+
+
+{{< code file="example-youtube-input-with-autoplay.md" >}}
+{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
+{{< /code >}}
+
+For [accessibility reasons](https://dequeuniversity.com/tips/provide-iframe-titles), it's best to provide a title for your YouTube video. You can do this using the shortcode by providing a `title` parameter. If no title is provided, a default of "YouTube Video" will be used.
+
+{{< code file="example-youtube-input-with-title.md" >}}
+{{</* youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" */>}}
+{{< /code >}}
+
+
+#### Example `youtube` Output
+
+Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
+
+{{< code file="example-youtube-output.html" >}}
+{{< youtube id="w7Ft2ymGmfc" autoplay="true" >}}
+{{< /code >}}
+
+#### Example `youtube` Display
+
+Using the preceding `youtube` example (without `autoplay="true"`), the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup. The video is also include in the [Quick Start of the Hugo documentation][quickstart].
+
+{{< youtube w7Ft2ymGmfc >}}
+
+## Privacy Config
+
+To learn how to configure your Hugo site to meet the new EU privacy regulation, see [Hugo and the GDPR][].
+
+## Create Custom Shortcodes
+
+To learn more about creating custom shortcodes, see the [shortcode template documentation][].
+
+[`figure` shortcode]: #figure
+[contentmanagementsection]: /content-management/formats/
+[examplegist]: https://gist.github.com/spf13/7896402
+[figureelement]: https://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
+[Hugo and the GDPR]: /about/hugo-and-gdpr/
+[Instagram]: https://www.instagram.com/
+[pagevariables]: /variables/page/
+[partials]: /templates/partials/
+[quickstart]: /getting-started/quick-start/
+[sctemps]: /templates/shortcode-templates/
+[scvars]: /variables/shortcodes/
+[shortcode template documentation]: /templates/shortcode-templates/
+[templatessection]: /templates/
+[Vimeo]: https://vimeo.com/
+[YouTube Videos]: https://www.youtube.com/
+[YouTube Input shortcode]: #youtube
--- /dev/null
- In the case above we should merge the last to commits in the commit of this tutorial (`Add "How to contribute to Hugo" tutorial`). You can "squash" commits, i.e. merge two or more commits into a single one.
+---
+title: Contribute to Hugo Development
+linktitle: Development
+description: Hugo relies heavily on contributions from the open source community.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [contribute]
+keywords: [dev,open source]
+authors: [digitalcraftsman]
+menu:
+ docs:
+ parent: "contribute"
+ weight: 10
+weight: 10
+sections_weight: 10
+draft: false
+toc: true
+---
+
+## Introduction
+
+Hugo is an open-source project and lives by the work of its [contributors][]. There are plenty of [open issues][issues], and we need your help to make Hugo even more awesome. You don't need to be a Go guru to contribute to the project's development.
+
+## Assumptions
+
+This contribution guide takes a step-by-step approach in hopes of helping newcomers. Therefore, we only assume the following:
+
+* You are new to Git or open-source projects in general
+* You are a fan of Hugo and enthusiastic about contributing to the project
+
+{{% note "Additional Questions?" %}}
+If you're struggling at any point in this contribution guide, reach out to the Hugo community in [Hugo's Discussion forum](https://discourse.gohugo.io).
+{{% /note %}}
+
+## Install Go
+
+The installation of Go should take only a few minutes. You have more than one option to get Go up and running on your machine.
+
+If you are having trouble following the installation guides for Go, check out [Go Bootcamp, which contains setups for every platform][gobootcamp] or reach out to the Hugo community in the [Hugo Discussion Forums][forums].
+
+### Install Go From Source
+
+[Download the latest stable version of Go][godl] and follow the official [Go installation guide][goinstall].
+
+Once you're finished installing Go, let's confirm everything is working correctly. Open a terminal---or command line under Windows--and type the following:
+
+```
+go version
+```
+
+You should see something similar to the following written to the console. Note that the version here reflects the most recent version of Go as of the last update for this page:
+
+```
+go version go1.12 darwin/amd64
+```
+
+Next, make sure that you set up your `GOPATH` [as described in the installation guide][setupgopath].
+
+You can print the `GOPATH` with `echo $GOPATH`. You should see a non-empty string containing a valid path to your Go workspace; for example:
+
+```
+/Users/<yourusername>/Code/go
+```
+
+### Install Go with Homebrew
+
+If you are a MacOS user and have [Homebrew](https://brew.sh/) installed on your machine, installing Go is as simple as the following command:
+
+{{< code file="install-go.sh" >}}
+brew install go
+{{< /code >}}
+
+### Install Go via GVM
+
+More experienced users can use the [Go Version Manager][gvm] (GVM). GVM allows you to switch between different Go versions *on the same machine*. If you're a beginner, you probably don't need this feature. However, GVM makes it easy to upgrade to a new released Go version with just a few commands.
+
+GVM comes in especially handy if you follow the development of Hugo over a longer period of time. Future versions of Hugo will usually be compiled with the latest version of Go. Sooner or later, you will have to upgrade if you want to keep up.
+
+## Create a GitHub Account
+
+If you're going to contribute code, you'll need to have an account on GitHub. Go to [www.github.com/join](https://github.com/join) and set up a personal account.
+
+## Install Git on Your System
+
+You will need to have Git installed on your computer to contribute to Hugo development. Teaching Git is outside the scope of the Hugo docs, but if you're looking for an excellent reference to learn the basics of Git, we recommend the [Git book][gitbook] if you are not sure where to begin. We will include short explanations of the Git commands in this document.
+
+Git is a [version control system](https://en.wikipedia.org/wiki/Version_control) to track the changes of source code. Hugo depends on smaller third-party packages that are used to extend the functionality. We use them because we don't want to reinvent the wheel.
+
+Go ships with a sub-command called `get` that will download these packages for us when we setup our working environment. The source code of the packages is tracked with Git. `get` will interact with the Git servers of the package hosters in order to fetch all dependencies.
+
+Move back to the terminal and check if Git is already installed. Type in `git version` and press enter. You can skip the rest of this section if the command returned a version number. Otherwise [download](https://git-scm.com/downloads) the latest version of Git and follow this [installation guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
+
+Finally, check again with `git version` if Git was installed successfully.
+
+### Git Graphical Front Ends
+
+There are several [GUI clients](https://git-scm.com/downloads/guis) that help you to operate Git. Not all are available for all operating systems and maybe differ in their usage. Because of this we will document how to use the command line, since the commands are the same everywhere.
+
+### Install Hub on Your System (Optional)
+
+Hub is a great tool for working with GitHub. The main site for it is [hub.github.com](https://hub.github.com/). Feel free to install this little Git wrapper.
+
+On a Mac, you can install [Hub](https://github.com/github/hub) using [Homebrew](https://brew.sh):
+
+```
+brew install hub
+```
+
+Now we'll create an [alias in Bash](https://tldp.org/LDP/abs/html/aliases.html) so that typing `git` actually runs `Hub`:
+
+```
+echo "alias git='hub'" >> ~/.bash_profile
+```
+
+Confirm the installation:
+
+```
+git version 2.21.0
+hub version 2.10.0
+```
+
+## Set up your working copy
+
+You set up the working copy of the repository locally on your computer. Your local copy of the files is what you'll edit, compile, and end up pushing back to GitHub. The main steps are cloning the repository and creating your fork as a remote.
+
+### Clone the repository
+
+We assume that you've set up your `GOPATH` (see the section above if you're unsure about this). You should now copy the Hugo repository down to your computer. You'll hear this called "clone the repo". GitHub's [help pages](https://help.github.com/articles/cloning-a-repository/) give us a short explanation:
+
+> When you create a repository on GitHub, it exists as a remote repository. You can create a local clone of your repository on your computer and sync between the two locations.
+
+We're going to clone the [master Hugo repository](https://github.com/gohugoio/hugo). That seems counter-intuitive, since you won't have commit rights on it. But it's required for the Go workflow. You'll work on a copy of the master and push your changes to your own repository on GitHub.
+
+So, let's make a new directory and clone that master repository:
+
+```
+mkdir $HOME/src
+cd $HOME/src
+git clone https://github.com/gohugoio/hugo.git
+```
+
+> Since Hugo 0.48, Hugo uses the Go Modules support built into Go 1.11 to build.
+> The easiest is to clone Hugo in a directory outside of GOPATH
+
+And then, install dependencies of Hugo by running the following in the cloned directory:
+
+```
+cd $HOME/src/hugo
+go install
+```
+
+
+Hugo relies on [mage](https://github.com/magefile/mage) for some convenient build and test targets. If you don't already have it, get it:
+
+```
+go get github.com/magefile/mage
+```
+
+### Fork the repository
+
+If you're not familiar with this term, GitHub's [help pages](https://help.github.com/articles/fork-a-repo/) provide again a simple explanation:
+
+> A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
+
+#### Fork by hand
+
+Open the [Hugo repository](https://github.com/gohugoio/hugo) on GitHub and click on the "Fork" button in the top right.
+
+
+
+Now open your fork repository on GitHub and copy the remote url of your fork. You can choose between HTTPS and SSH as protocol that Git should use for the following operations. HTTPS works always [if you're not sure](https://help.github.com/articles/which-remote-url-should-i-use/).
+
+
+
+Switch back to the terminal and move into the directory of the cloned master repository from the last step.
+
+```
+cd $HOME/src/hugo
+```
+
+Now Git needs to know that our fork exists by adding the copied remote url:
+
+```
+git remote add <YOUR-GITHUB-USERNAME> <COPIED REMOTE-URL>
+```
+
+#### Fork with Hub
+
+Alternatively, you can use the Git wrapper Hub. Hub makes forking a repository easy:
+
+```
+git fork
+```
+
+That command will log in to GitHub using your account, create a fork of the repository that you're currently working in, and add it as a remote to your working copy.
+
+#### Trust, but verify
+
+Let's check if everything went right by listing all known remotes:
+
+```
+git remote -v
+```
+
+The output should look similar:
+
+```
+digitalcraftsman git@github.com:digitalcraftsman/hugo.git (fetch)
+digitalcraftsman git@github.com:digitalcraftsman/hugo.git (push)
+origin https://github.com/gohugoio/hugo (fetch)
+origin https://github.com/gohugoio/hugo (push)
+```
+
+## The Hugo Git Contribution Workflow
+
+### Create a new branch
+
+You should never develop against the "master" branch. The development team will not accept a pull request against that branch. Instead, create a descriptive named branch and work on it.
+
+First, you should always pull the latest changes from the master repository:
+
+```
+git checkout master
+git pull
+```
+
+Now we can create a new branch for your additions:
+
+```
+git checkout -b <BRANCH-NAME>
+```
+
+You can check on which branch you are with `git branch`. You should see a list of all local branches. The current branch is indicated with a little asterisk.
+
+### Contribute to Documentation
+
+Perhaps you want to start contributing to the Hugo docs. If so, you can ignore most of the following steps and focus on the `/docs` directory within your newly cloned repository. You can change directories into the Hugo docs using `cd docs`.
+
+You can start Hugo's built-in server via `hugo server`. Browse the documentation by entering [http://localhost:1313](http://localhost:1313) in the address bar of your browser. The server automatically updates the page whenever you change content.
+
+We have developed a [separate Hugo documentation contribution guide][docscontrib] for more information on how the Hugo docs are built, organized, and improved by the generosity of people like you.
+
+### Build Hugo
+
+While making changes in the codebase it's a good idea to build the binary to test them:
+
+```
+mage hugo
+```
+
+This command generates the binary file at the root of the repository.
+
+If you want to install the binary in `$GOPATH/bin`, run
+
+```
+mage install
+```
+
+### Test
+Sometimes changes on the codebase can cause unintended side effects. Or they don't work as expected. Most functions have their own test cases. You can find them in files ending with `_test.go`.
+
+Make sure the commands
+
+```
+mage -v check
+```
+
+passes.
+
+### Formatting
+The Go code styleguide maybe is opinionated but it ensures that the codebase looks the same, regardless who wrote the code. Go comes with its own formatting tool. Let's apply the styleguide to our additions:
+
+```
+mage fmt
+```
+
+Once you made your additions commit your changes. Make sure that you follow our [code contribution guidelines](https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md):
+
+```
+# Add all changed files
+git add --all
+git commit --message "YOUR COMMIT MESSAGE"
+```
+
+The commit message should describe what the commit does (e.g. add feature XYZ), not how it is done.
+
+### Modify commits
+
+You noticed some commit messages don't fulfill the code contribution guidelines or you just forget something to add some files? No problem. Git provides the necessary tools to fix such problems. The next two methods cover all common cases.
+
+If you are unsure what a command does leave the commit as it is. We can fix your commits later in the pull request.
+
+#### Modify the last commit
+
+Let's say you want to modify the last commit message. Run the following command and replace the current message:
+
+```
+git commit --amend -m"YOUR NEW COMMIT MESSAGE"
+```
+
+Take a look at the commit log to see the change:
+
+```
+git log
+# Exit with q
+```
+
+After making the last commit you may have forgot something. There is no need to create a new commit. Just add the latest changes and merge them into the intended commit:
+
+```
+git add --all
+git commit --amend
+```
+
+#### Modify multiple commits
+
+{{% warning "Be Careful Modifying Multiple Commits"%}}
+Modifications such as those described in this section can have serious unintended consequences. Skip this section if you're not sure!
+{{% /warning %}}
+
+This is a bit more advanced. Git allows you to [rebase](https://git-scm.com/docs/git-rebase) commits interactively. In other words: it allows you to rewrite the commit history.
+
+```
+git rebase --interactive @~6
+```
+
+The `6` at the end of the command represents the number of commits that should be modified. An editor should open and present a list of last six commit messages:
+
+```
+pick 80d02a1 tpl: Add hasPrefix to the template funcs' "smoke test"
+pick aaee038 tpl: Sort the smoke tests
+pick f0dbf2c tpl: Add the other test case for hasPrefix
+pick 911c35b Add "How to contribute to Hugo" tutorial
+pick 33c8973 Begin workflow
+pick 3502f2e Refactoring and typo fixes
+```
+
++In the case above we should merge the last two commits in the commit of this tutorial (`Add "How to contribute to Hugo" tutorial`). You can "squash" commits, i.e. merge two or more commits into a single one.
+
+All operations are written before the commit message. Replace "pick" with an operation. In this case `squash` or `s` for short:
+
+```
+pick 80d02a1 tpl: Add hasPrefix to the template funcs' "smoke test"
+pick aaee038 tpl: Sort the smoke tests
+pick f0dbf2c tpl: Add the other test case for hasPrefix
+pick 911c35b Add "How to contribute to Hugo" tutorial
+squash 33c8973 Begin workflow
+squash 3502f2e Refactoring and typo fixes
+```
+
+We also want to rewrite the commits message of the third last commit. We forgot "docs:" as prefix according to the code contribution guidelines. The operation to rewrite a commit is called `reword` (or `r` as shortcut).
+
+You should end up with a similar setup:
+
+```
+pick 80d02a1 tpl: Add hasPrefix to the template funcs' "smoke test"
+pick aaee038 tpl: Sort the smoke tests
+pick f0dbf2c tpl: Add the other test case for hasPrefix
+reword 911c35b Add "How to contribute to Hugo" tutorial
+squash 33c8973 Begin workflow
+squash 3502f2e Refactoring and typo fixes
+```
+
+Close the editor. It should open again with a new tab. A text is instructing you to define a new commit message for the last two commits that should be merged (aka "squashed"). Save the file with <kbd>CTRL</kbd>+<kbd>S</kbd> and close the editor again.
+
+A last time a new tab opens. Enter a new commit message and save again. Your terminal should contain a status message. Hopefully this one:
+
+```
+Successfully rebased and updated refs/heads/<BRANCHNAME>.
+```
+
+Check the commit log if everything looks as expected. Should an error occur you can abort this rebase with `git rebase --abort`.
+
+### Push commits
+
+To push our commits to the fork on GitHub we need to specify a destination. A destination is defined by the remote and a branch name. Earlier, the defined that the remote url of our fork is the same as our GitHub handle, in my case `digitalcraftsman`. The branch should have the same as our local one. This makes it easy to identify corresponding branches.
+
+```
+git push --set-upstream <YOUR-GITHUB-USERNAME> <BRANCHNAME>
+```
+
+Now Git knows the destination. Next time when you to push commits you just need to enter `git push`.
+
+If you modified your commit history in the last step GitHub will reject your try to push. This is a safety-feature because the commit history isn't the same and new commits can't be appended as usual. You can enforce this push explicitly with `git push --force`.
+
+## Open a pull request
+
+We made a lot of progress. Good work. In this step we finally open a pull request to submit our additions. Open the [Hugo master repository](https://github.com/gohugoio/hugo/) on GitHub in your browser.
+
+You should find a green button labeled with "New pull request". But GitHub is clever and probably suggests you a pull request like in the beige box below:
+
+
+
+The new page summaries the most important information of your pull request. Scroll down and you find the additions of all your commits. Make sure everything looks as expected and click on "Create pull request".
+
+### Accept the contributor license agreement
+
+Last but not least you should accept the contributor license agreement (CLA). A new comment should be added automatically to your pull request. Click on the yellow badge, accept the agreement and authenticate yourself with your GitHub account. It just takes a few clicks and only needs to be done once.
+
+
+
+### Automatic builds
+
+We use the [Travis CI loop](https://travis-ci.org/gohugoio/hugo) (Linux and OS X) and [AppVeyor](https://ci.appveyor.com/project/gohugoio/hugo/branch/master) (Windows) to compile Hugo with your additions. This should ensure that everything works as expected before merging your pull request. This in most cases only relevant if you made changes to the codebase of Hugo.
+
+
+
+Above you can see that Travis wasn't able to compile the changes in this pull request. Click on "Details" and try to investigate why the build failed. But it doesn't have to be your fault. Mostly, the `master` branch that we used as foundation for your pull request should build without problems.
+
+If you have questions, leave a comment in the pull request. We are willing to assist you.
+
+## Where to start?
+
+Thank you for reading through this contribution guide. Hopefully, we will see you again soon on GitHub. There are plenty of [open issues][issues] for you to help with.
+
+Feel free to [open an issue][newissue] if you think you found a bug or you have a new idea to improve Hugo. We are happy to hear from you.
+
+## Additional References for Learning Git and Go
+
+* [Codecademy's Free "Learn Git" Course][codecademy] (Free)
+* [Code School and GitHub's "Try Git" Tutorial][trygit] (Free)
+* [The Git Book][gitbook] (Free)
+* [Go Bootcamp][gobootcamp]
+* [GitHub Pull Request Tutorial, Thinkful][thinkful]
+
+
+[codecademy]: https://www.codecademy.com/learn/learn-git
+[contributors]: https://github.com/gohugoio/hugo/graphs/contributors
+[docscontrib]: /contribute/documentation/
+[forums]: https://discourse.gohugo.io
+[gitbook]: https://git-scm.com/
+[gobootcamp]: http://www.golangbootcamp.com/book/get_setup
+[godl]: https://golang.org/dl/
+[goinstall]: https://golang.org/doc/install
+[gvm]: https://github.com/moovweb/gvm
+[issues]: https://github.com/gohugoio/hugo/issues
+[newissue]: https://github.com/gohugoio/hugo/issues/new
+[releases]: /getting-started/
+[setupgopath]: https://golang.org/doc/code.html#Workspaces
+[thinkful]: https://www.thinkful.com/learn/github-pull-request-tutorial/
+[trygit]: https://try.github.io/levels/1/challenges/1
--- /dev/null
- godocref:
+---
+title: .GetPage
+description: "Gets a `Page` of a given `path`."
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [sections,lists,indexes]
+signature: [".GetPage PATH"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+`.GetPage` returns a page of a given `path`. Both `Site` and `Page` implements this method. The `Page` variant will, if given a relative path -- i.e. a path without a leading `/` -- try look for the page relative to the current page.
+
+{{% note %}}
+**Note:** We overhauled and simplified the `.GetPage` API in Hugo 0.45. Before that you needed to provide a `Kind` attribute in addition to the path, e.g. `{{ .Site.GetPage "section" "blog" }}`. This will still work, but is now superflous.
+{{% /note %}}
+
+
+```go-html-template
+{{ with .Site.GetPage "/blog" }}{{ .Title }}{{ end }}
+```
+
+This method wil return `nil` when no page could be found, so the above will not print anything if the blog section is not found.
+
+To find a regular page in the blog section::
+
+```go-html-template
+{{ with .Site.GetPage "/blog/my-post.md" }}{{ .Title }}{{ end }}
+```
+
+And since `Page` also provides a `.GetPage` method, the above is the same as:
+
+```go-html-template
+{{ with .Site.GetPage "/blog" }}
+{{ with .GetPage "my-post.md" }}{{ .Title }}{{ end }}
+{{ end }}
+```
+
+## .GetPage and Multilingual Sites
+
+The previous examples have used the full content filename to lookup the post. Depending on how you have organized your content (whether you have the language code in the file name or not, e.g. `my-post.en.md`), you may want to do the lookup without extension. This will get you the current language's version of the page:
+
+```go-html-template
+{{ with .Site.GetPage "/blog/my-post" }}{{ .Title }}{{ end }}
+```
+
+## .GetPage Example
+
+This code snippet---in the form of a [partial template][partials]---allows you to do the following:
+
+1. Grab the index object of your `tags` [taxonomy][].
+2. Assign this object to a variable, `$t`
+3. Sort the terms associated with the taxonomy by popularity.
+4. Grab the top two most popular terms in the taxonomy (i.e., the two most popular tags assigned to content.
+
+{{< code file="grab-top-two-tags.html" >}}
+<ul class="most-popular-tags">
+{{ $t := .Site.GetPage "/tags" }}
+{{ range first 2 $t.Data.Terms.ByCount }}
+ <li>{{ . }}</li>
+{{ end }}
+</ul>
+{{< /code >}}
+
+## `.GetPage` on Page Bundles
+
+If the page retrieved by `.GetPage` is a [Leaf Bundle][leaf_bundle], and you
+need to get the nested _**page** resources_ in that, you will need to use the
+methods in `.Resources` as explained in the [Page Resources][page_resources]
+section.
+
+See the [Headless Bundle][headless_bundle] documentation for an example.
+
+
+[partials]: /templates/partials/
+[taxonomy]: /content-management/taxonomies/
+[page_kinds]: /templates/section-templates/#page-kinds
+[leaf_bundle]: /content-management/page-bundles/#leaf-bundles
+[headless_bundle]: /content-management/page-bundles/#headless-bundle
+[page_resources]: /content-management/page-resources/
--- /dev/null
- godocref:
+---
+title: .RenderString
+description: "Renders markup to HTML."
+date: 2019-12-18
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [markdown,goldmark,render]
+signature: [".RenderString MARKUP"]
+---
+
+{{< new-in "0.62.0" >}}
+
+`.RenderString` is a method on `Page` that renders some markup to HTML using the content renderer defined for that page (if not set in the options).
+
+*Note* that this method does not parse and render shortcodes.
+
+The method takes an optional map argument with these options:
+
+display ("inline")
+: `inline` or `block`. If `inline` (default), surrounding `<p></p>` on short snippets will be trimmed.
+
+markup (defaults to the Page's markup)
+: See identifiers in [List of content formats](/content-management/formats/#list-of-content-formats).
+
+Some examples:
+
+```go-html-template
+{{ $optBlock := dict "display" "block" }}
+{{ $optOrg := dict "markup" "org" }}
+{{ "**Bold Markdown**" | $p.RenderString }}
+{{ "**Bold Block Markdown**" | $p.RenderString $optBlock }}
+{{ "/italic org mode/" | $p.RenderString $optOrg }}
+```
+
+
+**Note** that this method is more powerful than the similar [markdownify](/functions/markdownify/) function as it also supports [Render Hooks](/getting-started/configuration-markup/#markdown-render-hooks) and it has options to render other markup formats.
--- /dev/null
- godocref:
+---
+title: Functions Quick Reference
+linktitle: Functions Quick Reference
+description: Comprehensive list of Hugo templating functions, including basic and advanced usage examples.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: []
+menu:
+ docs:
+ parent: "functions"
+weight: 01 #rem
+draft: false
+aliases: [/layout/functions/,/templates/functions]
+---
+
+Go templates are lightweight but extensible. Go itself supplies built-in functions, including comparison operators and other basic tools. These are listed in the [Go template documentation][gofuncs]. Hugo has added additional functions to the basic template logic.
+
+[gofuncs]: https://golang.org/pkg/text/template/#hdr-Functions
--- /dev/null
- godocref:
+---
+title: absLangURL
+description: Adds the absolute URL with correct language prefix according to site configuration for multilingual.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [multilingual,i18n,urls]
+signature: ["absLangURL INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [relLangURL]
+deprecated: false
+aliases: []
+---
+
+Both `absLangURL` and [`relLangURL`](/functions/rellangurl/) are similar to their [`absURL`](/functions/absurl/) and [`relURL`](/functions/relurl) relatives but will add the correct language prefix when the site is configured with more than one language.
+
+So for a site `baseURL` set to `https://example.com/hugo/` and the current language is `en`:
+
+```
+{{ "blog/" | absLangURL }} → "https://example.com/hugo/en/blog/"
+{{ "blog/" | relLangURL }} → "/hugo/en/blog/"
+```
--- /dev/null
- godocref:
+---
+title: absURL
+description: Creates an absolute URL based on the configured baseURL.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [urls]
+signature: ["absURL INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [relURL]
+deprecated: false
+aliases: []
+---
+
+Both `absURL` and `relURL` consider the configured value of `baseURL` in your site's [`config` file][configuration]. Given a `baseURL` set to `https://example.com/hugo/`:
+
+```
+{{ "mystyle.css" | absURL }} → "https://example.com/hugo/mystyle.css"
+{{ "mystyle.css" | relURL }} → "/hugo/mystyle.css"
+{{ "http://gohugo.io/" | relURL }} → "http://gohugo.io/"
+{{ "http://gohugo.io/" | absURL }} → "http://gohugo.io/"
+```
+
+The last two examples may look strange but can be very useful. For example, the following shows how to use `absURL` in [JSON-LD structured data (SEO)][jsonld], where some of your images for a piece of content may or may not be hosted locally:
+
+{{< code file="layouts/partials/schemaorg-metadata.html" download="schemaorg-metadata.html" >}}
+<script type="application/ld+json">
+{
+ "@context" : "http://schema.org",
+ "@type" : "BlogPosting",
+ "image" : {{ apply .Params.images "absURL" "." }}
+}
+</script>
+{{< /code >}}
+
+The above uses the [apply function][] and also exposes how the Go template parser JSON-encodes objects inside `<script>` tags. See [the safeJS template function][safejs] for examples of how to tell Hugo not to escape strings inside of such tags.
+
+{{% note "Ending Slash" %}}
+`absURL` and `relURL` are smart about missing slashes, but they will *not* add a closing slash to a URL if it is not present.
+{{% /note %}}
+
+[apply function]: /functions/apply/
+[configuration]: /getting-started/configuration/
+[jsonld]: https://developers.google.com/search/docs/guides/intro-structured-data
+[safejs]: /functions/safejs
--- /dev/null
- godocref: https://golang.org/pkg/time/#Time.AddDate
+---
+title: .AddDate
+description: Returns the time corresponding to adding the given number of years, months, and days passed to the function.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [dates,time]
+signature: [".AddDate YEARS MONTHS DAYS"]
+workson: [times]
+hugoversion:
+relatedfuncs: [now]
+deprecated: false
+aliases: []
+---
+
+
+The `AddDate` function takes three arguments in logical order of `years`, `months`, and `days`.
+
+## Example: Randomized Tweets from the Last 2 Years
+
+Let's assume you have a file at `data/tweets.toml` that contains a list of Tweets to display on your site's homepage. The file is filled with `[[tweet]]` blocks; e.g.---
+
+{{< code-toggle file="data/tweets" >}}
+[[tweet]]
+name = "Steve Francia"
+twitter_handle = "@spf13"
+quote = "I'm creator of Hugo. #metadocreference"
+link = "https://twitter.com/spf13"
+date = "2017-01-07T00:00:00Z"
+{{< /code-toggle >}}
+
+Let's assume you want to grab Tweets from the last two years and present them in a random order. In conjunction with the [`where`](/functions/where/) and [`now`](/functions/now/) functions, you can limit our range to the last two years via `now.AddDate -2 0 0`, which represents a point in time 2 years, 0 months, and 0 days before the time of your last site build.
+
+{{< code file="partials/templates/random-tweets.html" download="tweets.html" >}}
+{{ range where $.Site.Data.tweets.tweet "date" "ge" (now.AddDate -2 0 0) | shuffle }}
+ <div class="item">
+ <blockquote>
+ <p>
+ {{ .quote | safeHTML }}
+ </p>
+ — {{ .name }} ({{ .twitter_handle }}) <a href="{{ .link }}">
+ {{ dateFormat "January 2, 2006" .date }}
+ </a>
+ </blockquote>
+ </div>
+{{ end }}
+{{< /code >}}
--- /dev/null
- godocref:
+---
+title: after
+description: "`after` slices an array to only the items after the <em>N</em>th item."
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [iteration]
+signature: ["after INDEX COLLECTION"]
+workson: []
+hugoversion:
+relatedfuncs: [last,first,seq]
+deprecated: false
+aliases: []
+---
+
+The following shows `after` being used in conjunction with the [`slice` function][slice]:
+
+```
+{{ $data := slice "one" "two" "three" "four" }}
+{{ range after 2 $data }}
+ {{ . }}
+{{ end }}
+→ ["three", "four"]
+```
+
+## Example of `after` with `first`: 2nd–4th Most Recent Articles
+
+You can use `after` in combination with the [`first` function][] and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page][] to show only two rows:
+
+1. The top row is titled "Featured" and shows only the most recently published article (i.e. by `publishdate` in the content files' front matter).
+2. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.
+
+{{< code file="layouts/section/articles.html" download="articles.html" >}}
+{{ define "main" }}
+<section class="row featured-article">
+ <h2>Featured Article</h2>
+ {{ range first 1 .Pages.ByPublishDate.Reverse }}
+ <header>
+ <h3><a href="{{.Permalink}}">{{.Title}}</a></h3>
+ </header>
+ <p>{{.Description}}</p>
+ {{ end }}
+</section>
+<div class="row recent-articles">
+ <h2>Recent Articles</h2>
+ {{ range first 3 (after 1 .Pages.ByPublishDate.Reverse) }}
+ <section class="recent-article">
+ <header>
+ <h3><a href="{{.Permalink}}">{{.Title}}</a></h3>
+ </header>
+ <p>{{.Description}}</p>
+ </section>
+ {{ end }}
+</div>
+{{ end }}
+{{< /code >}}
+
+[`first` function]: /functions/first/
+[list/section page]: /templates/section-templates/
+[lists]: /templates/lists/#order-content
+[slice]: /functions/slice/
--- /dev/null
- godocref:
+---
+title: apply
+description: Given a map, array, or slice, `apply` returns a new slice with a function applied over it.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [advanced]
+signature: ["apply COLLECTION FUNCTION [PARAM...]"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+{{< todo >}}
+POTENTIAL NEW CONTENT: see apply/sequence discussion: https://discourse.gohugo.io/t/apply-printf-on-a-sequence/5722;
+{{< /todo >}}
+
+`apply` expects at least three parameters, depending on the function being applied.
+
+1. The first parameter is the sequence to operate on.
+2. The second parameter is the name of the function as a string, which must be the name of a valid [Hugo function][functions].
+3. After that, the parameters to the applied function are provided, with the string `"."` standing in for each element of the sequence the function is to be applied against.
+
+Here is an example of a content file with `names:` as a front matter field:
+
+```
++++
+names: [ "Derek Perkins", "Joe Bergevin", "Tanner Linsley" ]
++++
+```
+
+You can then use `apply` as follows:
+
+```
+{{ apply .Params.names "urlize" "." }}
+```
+
+Which will result in the following:
+
+```
+"derek-perkins", "joe-bergevin", "tanner-linsley"
+```
+
+This is *roughly* equivalent to using the following with [range][]:
+
+```
+{{ range .Params.names }}{{ . | urlize }}{{ end }}
+```
+
+However, it is not possible to provide the output of a range to the [`delimit` function][delimit], so you need to `apply` it.
+
+If you have `post-tag-list.html` and `post-tag-link.html` as [partials][], you *could* use the following snippets, respectively:
+
+{{< code file="layouts/partials/post-tag-list.html" copy="false" >}}
+{{ with .Params.tags }}
+<div class="tags-list">
+ Tags:
+ {{ $len := len . }}
+ {{ if eq $len 1 }}
+ {{ partial "post-tag-link" (index . 0) }}
+ {{ else }}
+ {{ $last := sub $len 1 }}
+ {{ range first $last . }}
+ {{ partial "post-tag-link" . }},
+ {{ end }}
+ {{ partial "post-tag-link" (index . $last) }}
+ {{ end }}
+</div>
+{{ end }}
+{{< /code >}}
+
+{{< code file="layouts/partials/post-tag-link.html" copy="false" >}}
+<a class="post-tag post-tag-{{ . | urlize }}" href="/tags/{{ . | urlize }}">{{ . }}</a>
+{{< /code >}}
+
+This works, but the complexity of `post-tag-list.html` is fairly high. The Hugo template needs to perform special behavior for the case where there’s only one tag, and it has to treat the last tag as special. Additionally, the tag list will be rendered something like `Tags: tag1 , tag2 , tag3` because of the way that the HTML is generated and then interpreted by a browser.
+
+This first version of `layouts/partials/post-tag-list.html` separates all of the operations for ease of reading. The combined and DRYer version is shown next:
+
+```
+{{ with .Params.tags }}
+ <div class="tags-list">
+ Tags:
+ {{ $sort := sort . }}
+ {{ $links := apply $sort "partial" "post-tag-link" "." }}
+ {{ $clean := apply $links "chomp" "." }}
+ {{ delimit $clean ", " }}
+ </div>
+{{ end }}
+```
+
+Now in the completed version, you can sort the tags, convert the tags to links with `layouts/partials/post-tag-link.html`, [chomp][] off stray newlines, and join the tags together in a delimited list for presentation. Here is an even DRYer version of the preceding example:
+
+{{< code file="layouts/partials/post-tag-list.html" download="post-tag-list.html" >}}
+ {{ with .Params.tags }}
+ <div class="tags-list">
+ Tags:
+ {{ delimit (apply (apply (sort .) "partial" "post-tag-link" ".") "chomp" ".") ", " }}
+ </div>
+ {{ end }}
+{{< /code >}}
+
+{{% note %}}
+`apply` does not work when receiving the sequence as an argument through a pipeline.
+{{% /note %}}
+
+[chomp]: /functions/chomp/ "See documentation for the chomp function"
+[delimit]: /functions/delimit/ "See documentation for the delimit function"
+[functions]: /functions/ "See the full list of Hugo functions to see what can be passed as an argument to the apply function."
+[partials]: /templates/partials/
+[range]: /functions/range/ "Learn the importance of the range function, a fundamental keyword in both Hugo templates and the Go programming language."
--- /dev/null
- godocref:
+---
+title: base64
+description: "`base64Encode` and `base64Decode` let you easily decode content with a base64 encoding and vice versa through pipes."
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+relatedfuncs: []
+signature: ["base64Decode INPUT", "base64Encode INPUT"]
+workson: []
+hugoversion:
+deprecated: false
+draft: false
+aliases: []
+---
+
+An example:
+
+{{< code file="base64-input.html" >}}
+<p>Hello world = {{ "Hello world" | base64Encode }}</p>
+<p>SGVsbG8gd29ybGQ = {{ "SGVsbG8gd29ybGQ=" | base64Decode }}</p>
+{{< /code >}}
+
+{{< output file="base-64-output.html" >}}
+<p>Hello world = SGVsbG8gd29ybGQ=</p>
+<p>SGVsbG8gd29ybGQ = Hello world</p>
+{{< /output >}}
+
+You can also pass other data types as arguments to the template function which tries to convert them. The following will convert *42* from an integer to a string because both `base64Encode` and `base64Decode` always return a string.
+
+```
+{{ 42 | base64Encode | base64Decode }}
+=> "42" rather than 42
+```
+
+## `base64` with APIs
+
+Using base64 to decode and encode becomes really powerful if we have to handle
+responses from APIs.
+
+```
+{{ $resp := getJSON "https://api.github.com/repos/gohugoio/hugo/readme" }}
+{{ $resp.content | base64Decode | markdownify }}
+```
+
+The response of the GitHub API contains the base64-encoded version of the [README.md](https://github.com/gohugoio/hugo/blob/master/README.md) in the Hugo repository. Now we can decode it and parse the Markdown. The final output will look similar to the rendered version on GitHub.
--- /dev/null
- godocref: Removes any trailing newline characters.
+---
+title: chomp
++toc: true
+description: Removes any trailing newline characters.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [trim]
+signature: ["chomp INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [truncate]
+deprecated: false
+---
+
+Useful in a pipeline to remove newlines added by other processing (e.g., [`markdownify`](/functions/markdownify/)).
+
+```
+{{chomp "<p>Blockhead</p>\n"}} → "<p>Blockhead</p>"
+```
--- /dev/null
- godocref:
+---
+title: countrunes
+description: Determines the number of runes in a string excluding any whitespace.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [counting, word count]
+signature: ["countrunes INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+In contrast with `countwords` function, which counts every word in a string, the `countrunes` function determines the number of runes in the content and excludes any whitespace. This has specific utility if you are dealing with CJK-like languages.
+
+```
+{{ "Hello, 世界" | countrunes }}
+<!-- outputs a content length of 8 runes. -->
+```
+
+[pagevars]: /variables/page/
--- /dev/null
- godocref:
+---
+title: countwords
+description: Counts the number of words in a string.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [counting, word count]
+signature: ["countwords INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [countrunes]
+deprecated: false
+---
+
+The template function works similar to the [.WordCount page variable][pagevars].
+
+```
+{{ "Hugo is a static site generator." | countwords }}
+<!-- outputs a content length of 6 words. -->
+```
+
+
+[pagevars]: /variables/page/
--- /dev/null
- godocref: https://golang.org/pkg/time/
+---
+title: time.Format
+description: Converts a date/time to a localized string.
- Note that since Hugo 0.87.0, `time.Format` will return a localized string for the currrent language. {{< new-in "0.87.0" >}}
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [dates,time,strings]
+signature: ["time.Format LAYOUT INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [Format,now,Unix,time]
+deprecated: false
+---
+
+`time.Format` (alias `dateFormat`) converts either a `time.Time` object (e.g. `.Date`) or a timestamp string `INPUT` into the format specified by the `LAYOUT` string.
+
+```go-html-template
+{{ time.Format "Monday, Jan 2, 2006" "2015-01-21" }} → "Wednesday, Jan 21, 2015"
+```
+
- Go's date layout strings can be hard to reason about, especially with multiple languages. Since Hugo 0.87.0 you can alternatively use some predefined layout idenfifiers that will output localized dates or times:
++Note that since Hugo 0.87.0, `time.Format` will return a localized string for the current language. {{< new-in "0.87.0" >}}
+
+The `LAYOUT` string can be either:
+
+* [Go’s Layout String](/functions/format/#gos-layout-string) to learn about how the `LAYOUT` string has to be formatted. There are also some useful examples.
+* A custom Hugo layout identifier (see full list below)
+
+See the [`time` function](/functions/time/) to convert a timestamp string to a Go `time.Time` type value.
+
+
+## Date/time formatting layouts
+
+{{< new-in "0.87.0" >}}
+
++Go's date layout strings can be hard to reason about, especially with multiple languages. Since Hugo 0.87.0 you can alternatively use some predefined layout identifiers that will output localized dates or times:
+
+```go-html-template
+{{ .Date | time.Format ":date_long" }}
+```
+
+The full list of custom layouts with examples for English:
+
+* `:date_full` => `Wednesday, June 6, 2018`
+* `:date_long` => `June 6, 2018`
+* `:date_medium` => `Jun 6, 2018`
+* `:date_short` => `6/6/18`
+
+* `:time_full` => `2:09:37 am UTC`
+* `:time_long` => `2:09:37 am UTC`
+* `:time_medium` => `2:09:37 am`
+* `:time_short` => `2:09 am`
--- /dev/null
- godocref:
+---
+title: default
+description: Allows setting a default value that can be returned if a first value is not set.
+qref: "Returns a default value if a value is not set when checked."
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: [defaults]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: ["default DEFAULT INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+needsexamples: false
+---
+
+`default` checks whether a given value is set and returns a default value if it is not. *Set* in this context means different things depending on the data type:
+
+* non-zero for numeric types and times
+* non-zero length for strings, arrays, slices, and maps
+* any boolean or struct value
+* non-nil for any other types
+
+`default` function examples reference the following content page:
+
+{{< code file="content/posts/default-function-example.md" >}}
+---
+title: Sane Defaults
+seo_title:
+date: 2017-02-18
+font:
+oldparam: The default function helps make your templating DRYer.
+newparam:
+---
+{{< /code >}}
+
+`default` can be written in more than one way:
+
+```
+{{ index .Params "font" | default "Roboto" }}
+{{ default "Roboto" (index .Params "font") }}
+```
+
+Both of the above `default` function calls return `Roboto`.
+
+A `default` value, however, does not need to be hard coded like the previous example. The `default` value can be a variable or pulled directly from the front matter using dot notation:
+
+{{< code file="variable-as-default-value.html" nocopy="true" >}}
+{{$old := .Params.oldparam }}
+<p>{{ .Params.newparam | default $old }}</p>
+{{< /code >}}
+
+Which would return:
+
+```
+<p>The default function helps make your templating DRYer.</p>
+```
+
+And then using dot notation
+
+{{< code file="dot-notation-default-value.html" >}}
+<title>{{ .Params.seo_title | default .Title }}</title>
+{{< /code >}}
+
+Which would return
+
+{{< output file="dot-notation-default-return-value.html" >}}
+<title>Sane Defaults</title>
+{{< /output >}}
+
+The following have equivalent return values but are far less terse. This demonstrates the utility of `default`:
+
+Using `if`:
+
+{{< code file="if-instead-of-default.html" nocopy="true" >}}
+<title>{{if .Params.seo_title}}{{.Params.seo_title}}{{else}}{{.Title}}{{end}}</title>
+=> Sane Defaults
+{{< /code >}}
+
+Using `with`:
+
+{{< code file="with-instead-of-default.html" nocopy="true" >}}
+<title>{{with .Params.seo_title}}{{.}}{{else}}{{.Title}}{{end}}</title>
+=> Sane Defaults
+{{< /code >}}
--- /dev/null
- godocref:
+---
+title: delimit
+description: Loops through any array, slice, or map and returns a string of all the values separated by a delimiter.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [iteration]
+toc: false
+signature: ["delimit COLLECTION DELIMIT LAST"]
+workson: [lists,taxonomies,terms]
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+`delimit` called in your template takes the form of
+
+```
+{{ delimit array/slice/map delimiter optionallastdelimiter}}
+```
+
+`delimit` loops through any array, slice, or map and returns a string of all the values separated by a delimiter, the second argument in the function call. There is an optional third parameter that lets you choose a different delimiter to go between the last two values in the loop.
+
+To maintain a consistent output order, maps will be sorted by keys and only a slice of the values will be returned.
+
+The examples of `delimit` that follow all use the same front matter:
+
+{{< code file="delimit-example-front-matter.toml" nocopy="true" >}}
++++
+title: I love Delimit
+tags: [ "tag1", "tag2", "tag3" ]
++++
+{{< /code >}}
+
+{{< code file="delimit-page-tags-input.html" >}}
+<p>Tags: {{ delimit .Params.tags ", " }}</p>
+{{< /code >}}
+
+{{< output file="delimit-page-tags-output.html" >}}
+<p>Tags: tag1, tag2, tag3</p>
+{{< /output >}}
+
+Here is the same example but with the optional "last" delimiter:
+
+{{< code file="delimit-page-tags-final-and-input.html" >}}
+Tags: {{ delimit .Params.tags ", " ", and " }}
+{{< /code >}}
+
+{{< output file="delimit-page-tags-final-and-output.html" >}}
+<p>Tags: tag1, tag2, and tag3</p>
+{{< /output >}}
+
+
+[lists]: /templates/lists/
+[taxonomies]: /templates/taxonomy-templates/#taxonomy-list-templates
+[terms]: /templates/taxonomy-templates/#terms-list-templates
--- /dev/null
- godocref:
+---
+title: dict
+description: Creates a dictionary from a list of key and value pairs.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-26
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [dictionary]
+signature: ["dict KEY VALUE [KEY VALUE]..."]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+`dict` is especially useful for passing more than one value to a partial template.
+
+Note that the `key` can be either a `string` or a `string slice`. The latter is useful to create a deply nested structure, e.g.:
+
+```go-text-template
+{{ $m := dict (slice "a" "b" "c") "value" }}
+```
+
+
+## Example: Using `dict` to pass multiple values to a `partial`
+
+The partial below creates a SVG and expects `fill`, `height` and `width` from the caller:
+
+**Partial definition**
+
+{{< code file="layouts/partials/svgs/external-links.svg" download="external-links.svg" >}}
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+fill="{{ .fill }}" width="{{ .width }}" height="{{ .height }}" viewBox="0 0 32 32" aria-label="External Link">
+<path d="M25.152 16.576v5.696q0 2.144-1.504 3.648t-3.648 1.504h-14.848q-2.144 0-3.648-1.504t-1.504-3.648v-14.848q0-2.112 1.504-3.616t3.648-1.536h12.576q0.224 0 0.384 0.16t0.16 0.416v1.152q0 0.256-0.16 0.416t-0.384 0.16h-12.576q-1.184 0-2.016 0.832t-0.864 2.016v14.848q0 1.184 0.864 2.016t2.016 0.864h14.848q1.184 0 2.016-0.864t0.832-2.016v-5.696q0-0.256 0.16-0.416t0.416-0.16h1.152q0.256 0 0.416 0.16t0.16 0.416zM32 1.152v9.12q0 0.48-0.352 0.8t-0.8 0.352-0.8-0.352l-3.136-3.136-11.648 11.648q-0.16 0.192-0.416 0.192t-0.384-0.192l-2.048-2.048q-0.192-0.16-0.192-0.384t0.192-0.416l11.648-11.648-3.136-3.136q-0.352-0.352-0.352-0.8t0.352-0.8 0.8-0.352h9.12q0.48 0 0.8 0.352t0.352 0.8z"></path>
+</svg>
+{{< /code >}}
+
+**Partial call**
+
+The `fill`, `height` and `width` values can be stored in one object with `dict` and passed to the partial:
+
+{{< code file="layouts/_default/list.html" >}}
+{{ partial "svgs/external-links.svg" (dict "fill" "#01589B" "width" 10 "height" 20 ) }}
+{{< /code >}}
+
+
+
+[partials]: /templates/partials/
--- /dev/null
- godocref:
+---
+title: echoParam
+description: Prints a parameter if it is set.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["echoParam DICTIONARY KEY"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+
+```
+{{ echoParam .Params "project_url" }}
+```
--- /dev/null
- godocref:
+---
+title: emojify
+description: Runs a string through the Emoji emoticons processor.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,emojis]
+signature: ["emojify INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+`emoji` runs a passed string through the Emoji emoticons processor.
+
+See the [Emoji cheat sheet][emojis] for available emoticons.
+
+The `emojify` function can be called in your templates but not directly in your content files by default. For emojis in content files, set `enableEmoji` to `true` in your site's [configuration][config]. Then you can write emoji shorthand directly into your content files; e.g. <code>I :</code><code>heart</code><code>: Hugo!</code>:
+
+I :heart: Hugo!
+
+
+[config]: /getting-started/configuration/
+[emojis]: https://www.webfx.com/tools/emoji-cheat-sheet/
+[sc]: /templates/shortcode-templates/
+[scsource]: https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes
--- /dev/null
- godocref:
+---
+title: eq
+linktitle: eq
+description: Returns the boolean truth of arg1 == arg2.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [operators,logic]
+signature: ["eq ARG1 ARG2"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{ if eq .Section "blog" }}current{{ end }}
+```
--- /dev/null
- godocref:
+---
+title: "fileExists"
+linktitle: "fileExists"
+date: 2017-08-31T22:38:22+02:00
+description: Checks whether a file exists under the given path.
- In the example above, a banner from the `static` folder should be shown if the given path points to an existing file.
+publishdate: 2017-08-31T22:38:22+02:00
+lastmod: 2017-08-31T22:38:22+02:00
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+signature: ["fileExists PATH"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+`fileExists` allows you to check if a file exists under a given path, e.g. before inserting code into a template:
+
+```
+{{ if (fileExists "static/img/banner.jpg") -}}
+<img src="{{ "img/banner.jpg" | absURL }}" />
+{{- end }}
+```
+
++In the example above, a banner from the `static` folder should be shown if the given path points to an existing file.
--- /dev/null
- godocref:
+---
+title: findRE
+description: Returns a list of strings that match the regular expression.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [regex]
+signature: ["findRE PATTERN INPUT [LIMIT]"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+By default all matches will be included. The number of matches can be limited with an optional third parameter.
+
+The example below returns a list of all second level headers (`<h2>`) in the content:
+
+```
+{{ findRE "<h2.*?>(.|\n)*?</h2>" .Content }}
+```
+
+You can limit the number of matches in the list with a third parameter. The following example shows how to limit the returned value to just one match (or none, if there are no matched substrings):
+
+```
+{{ findRE "<h2.*?>(.|\n)*?</h2>" .Content 1 }}
+ <!-- returns ["<h2 id="#foo">Foo</h2>"] -->
+```
+
+{{% note %}}
+Hugo uses Go's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
+
+If you are just learning RegEx, or at least Go's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
+{{% /note %}}
+
+[partials]: /templates/partials/
+[`plainify`]: /functions/plainify/
+[toc]: /content-management/toc/
+[`urlize`]: /functions/urlize
--- /dev/null
- godocref:
+---
+title: first
+linktitle: first
+description: "Slices an array to only the first _N_ elements."
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [iteration]
+signature: ["first LIMIT COLLECTION"]
+workson: [lists,taxonomies,terms,groups]
+hugoversion:
+relatedfuncs: [after,last]
+deprecated: false
+aliases: []
+---
+
+`first` works in a similar manner to the [`limit` keyword in
+SQL][limitkeyword]. It reduces the array to only the `first N`
+elements. It takes the array and number of elements as input.
+
+`first` takes two arguments:
+1. `number of elements`
+2. `array` *or* `slice of maps or structs`
+
+{{< code file="layout/_default/section.html" >}}
+{{ range first 10 .Pages }}
+ {{ .Render "summary" }}
+{{ end }}
+{{< /code >}}
+
+*Note: Exclusive to `first`, LIMIT can be '0' to return an empty array.*
+
+## `first` and `where` Together
+
+Using `first` and [`where`][wherefunction] together can be very
+powerful. Below snippet gets a list of posts only from [**main
+sections**][mainsections], sorts it by the `title` parameter, and then
+ranges through only the first 5 posts in that list:
+
+{{< code file="first-and-where-together.html" >}}
+{{ range first 5 (where site.RegularPages "Type" "in" site.Params.mainSections).ByTitle }}
+ {{ .Content }}
+{{ end }}
+{{< /code >}}
+
+
+[limitkeyword]: https://www.techonthenet.com/sql/select_limit.php
+[wherefunction]: /functions/where/
+[mainsections]: /functions/where/#mainsections
--- /dev/null
- godocref:
+---
+title: float
+linktitle: float
+description: Creates a `float` from the argument passed into the function.
+date: 2017-09-28
+publishdate: 2017-09-28
+lastmod: 2017-09-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,floats]
+signature: ["float INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+Useful for turning strings into floating point numbers.
+
+```
+{{ float "1.23" }} → 1.23
+```
--- /dev/null
- godocref: https://golang.org/pkg/time/#example_Time_Format
+---
+title: .Format
+description: Formats built-in Hugo dates---`.Date`, `.PublishDate`, and `.Lastmod`---according to Go's layout string.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [dates,time]
+signature: [".Format FORMAT"]
+workson: [times]
+hugoversion:
+relatedfuncs: [dateFormat,now,Unix,time]
+deprecated: false
+aliases: []
+toc: true
+---
+
+`.Format` will format date values defined in your front matter and can be used as a property on the following [page variables][pagevars]:
+
+* `.PublishDate`
+* `.Date`
+* `.Lastmod`
+
+Assuming a key-value of `date: 2017-03-03` in a content file's front matter, your can run the date through `.Format` followed by a layout string for your desired output at build time:
+
+```
+{{ .PublishDate.Format "January 2, 2006" }} => March 3, 2017
+```
+
+For formatting *any* string representations of dates defined in your front matter, see the [`dateFormat` function][dateFormat], which will still leverage the Go layout string explained below but uses a slightly different syntax.
+
+## Go's Layout String
+
+Hugo templates [format your dates][time] via layout strings that point to a specific reference time:
+
+```
+Mon Jan 2 15:04:05 MST 2006
+```
+
+While this may seem arbitrary, the numerical value of `MST` is `07`, thus making the layout string a sequence of numbers.
+
+Here is a visual explanation [taken directly from the Go docs][gdex]:
+
+```
+ Jan 2 15:04:05 2006 MST
+=> 1 2 3 4 5 6 -7
+```
+
+### Hugo Date and Time Templating Reference
+
+The following examples show the layout string followed by the rendered output.
+
+The examples were rendered and tested in [CST][] and all point to the same field in a content file's front matter:
+
+```
+date: 2017-03-03T14:15:59-06:00
+```
+
+`.Date` (i.e. called via [page variable][pagevars])
+: **Returns**: `2017-03-03 14:15:59 -0600 CST`
+
+`"Monday, January 2, 2006"`
+: **Returns**: `Friday, March 3, 2017`
+
+`"Mon Jan 2 2006"`
+: **Returns**: `Fri Mar 3 2017`
+
+`"January 2006"`
+: **Returns**: `March 2017`
+
+`"2006-01-02"`
+: **Returns**: `2017-03-03`
+
+`"Monday"`
+: **Returns**: `Friday`
+
+`"02 Jan 06 15:04 MST"` (RFC822)
+: **Returns**: `03 Mar 17 14:15 CST`
+
+`"02 Jan 06 15:04 -0700"` (RFC822Z)
+: **Returns**: `03 Mar 17 14:15 -0600`
+
+`"Mon, 02 Jan 2006 15:04:05 MST"` (RFC1123)
+: **Returns**: `Fri, 03 Mar 2017 14:15:59 CST`
+
+`"Mon, 02 Jan 2006 15:04:05 -0700"` (RFC1123Z)
+: **Returns**: `Fri, 03 Mar 2017 14:15:59 -0600`
+
+More examples can be found in Go's [documentation for the time package][timeconst].
+
+### Cardinal Numbers and Ordinal Abbreviations
+
+Spelled-out cardinal numbers (e.g. "one", "two", and "three") are not currently supported.
+
+Ordinal abbreviations (i.e., with shorted suffixes like "1st", "2nd", and "3rd") are not currently directly supported. By using `{{.Date.Format "Jan 2nd 2006"}}`, Hugo assumes you want to append `nd` as a string to the day of the month. However, you can chain functions together to create something like this:
+
+```
+{{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} of {{ .Date.Format "January 2006" }}
+```
+
+This will output:
+
+```
+5th of March 2017
+```
+
+
+### Use `.Local` and `.UTC`
+
+In conjunction with the [`dateFormat` function][dateFormat], you can also convert your dates to `UTC` or to local timezones:
+
+`{{ dateFormat "02 Jan 06 15:04 MST" .Date.UTC }}`
+: **Returns**: `03 Mar 17 20:15 UTC`
+
+`{{ dateFormat "02 Jan 06 15:04 MST" .Date.Local }}`
+: **Returns**: `03 Mar 17 14:15 CST`
+
+[CST]: https://en.wikipedia.org/wiki/Central_Time_Zone
+[dateFormat]: /functions/dateformat/
+[gdex]: https://golang.org/pkg/time/#example_Time_Format
+[pagevars]: /variables/page/
+[time]: https://golang.org/pkg/time/
+[timeconst]: https://golang.org/pkg/time/#ANSIC
--- /dev/null
- godocref:
+---
+title: ge
+linktitle: ge
+description: Returns the boolean truth of arg1 >= arg2.
+date: 2017-07-26
+publishdate: 2017-07-26
+lastmod: 2017-07-26
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [operators,logic]
+signature: ["ge ARG1 ARG2"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{ if ge 10 5 }}true{{ end }}
+```
--- /dev/null
- godocref:
+---
+title: .Get
+description: Accesses positional and ordered parameters in shortcode declaration.
-
-
-
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [shortcodes]
+signature: [".Get INDEX", ".Get KEY"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+needsexample: true
+---
+
+
+`.Get` is specifically used when creating your own [shortcode template][sc], to access the [positional and named](/templates/shortcode-templates/#positional-vs-named-parameters) parameters passed to it. When used with a numeric INDEX, it queries positional parameters (starting with 0). With a string KEY, it queries named parameters.
+
+When accessing a named parameter that does not exist, `.Get` returns an empty string instead of interrupting the build. The same goes with positional parameters in hugo version 0.40 and after. This allows you to chain `.Get` with `if`, `with`, `default` or `cond` to check for parameter existence. For example, you may now use:
+
+```
+{{ $quality := default "100" (.Get 1) }}
+```
+
+[sc]: /templates/shortcode-templates/
--- /dev/null
- godocref:
+---
+title: getenv
+description: Returns the value of an environment variable.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["getenv VARIABLE"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+Takes a string containing the name of the variable as input. Returns
+an empty string if the variable is not set, otherwise returns the
+value of the variable.
+
+```
+{{ getenv "HOME" }}
+```
+
+{{% note %}}
+In Unix-like environments, the variable must also be exported in order to be seen by `hugo`.
+{{% /note %}}
--- /dev/null
- godocref:
+---
+title: gt
+linktitle: gt
+description: Returns the boolean truth of arg1 > arg2.
+date: 2017-07-26
+publishdate: 2017-07-26
+lastmod: 2017-07-26
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [operators,logic]
+signature: ["gt ARG1 ARG2"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{ if gt 10 5 }}true{{ end }}
+```
--- /dev/null
- godocref:
+---
+title: hasprefix
+linktitle: hasPrefix
+description: Tests whether a string begins with prefix.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["hasPrefix STRING PREFIX"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+* `{{ hasPrefix "Hugo" "Hu" }}` → true
--- /dev/null
- godocref:
+---
+title: .HasChildren
+description:
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [menus]
+toc:
+signature: ["HasChildren"]
+workson: [menus]
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: true
+aliases: []
+---
+
+Used in [menu templates](/templates/menu-templates/).
--- /dev/null
- godocref:
+---
+title: .HasMenuCurrent
+description:
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [menus]
+signature: ["PAGE.HasMenuCurrent MENU MENUENTRY"]
+workson: [menus]
+hugoversion:
+relatedfuncs: ["IsMenuCurrent"]
+deprecated: false
+toc: false
+draft: false
+aliases: []
+---
+
+`.HasMenuCurrent` is a method in `Page` object returning a _boolean_ value. It
+returns `true` if the PAGE is the same object as the `.Page` in one of the
+**children menu entries** under MENUENTRY in a given MENU.
+
+{{< new-in "0.86.0" >}} If MENUENTRY's `.Page` is a [section](/content-management/sections/) then, from Hugo `0.86.0`, this method also returns true for any descendant of that section..
+
+You can find its example use in [menu templates](/templates/menu-templates/).
--- /dev/null
- godocref:
+---
+title: highlight
+linktitle: highlight
+description: Takes a string of code and language declaration and uses Chroma to return syntax-highlighted HTML.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [highlighting,code blocks,syntax]
+signature: ["highlight INPUT LANG OPTIONS"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+[`highlight` is used in Hugo's built-in `highlight` shortcode][highlight].
+
+
+[highlight]: /content-management/shortcodes/#highlight
--- /dev/null
- godocref:
+---
+title: hmac
+linktitle: hmac
+description: Compute the cryptographic checksum of a message.
+date: 2020-05-29
+publishdate: 2020-05-29
+lastmod: 2020-05-29
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [hmac,checksum]
+signature: ["hmac HASH_TYPE KEY MESSAGE"]
+workson: []
+hugoversion:
+relatedfuncs: [hmac]
+deprecated: false
+aliases: [hmac]
+---
+
+`hmac` returns a cryptographic hash that uses a key to sign a message.
+
+```
+{{ hmac "sha256" "Secret key" "Hello world, gophers!"}},
+<!-- returns the string "b6d11b6c53830b9d87036272ca9fe9d19306b8f9d8aa07b15da27d89e6e34f40"
+```
+
+Supported hash functions:
+
+* md5
+* sha1
+* sha256
+* sha512
--- /dev/null
- godocref:
+---
+title: htmlEscape
+linktitle:
+description: Returns the given string with the reserved HTML codes escaped.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings, html]
+signature: ["htmlEscape INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [htmlUnescape]
+deprecated: false
+aliases: []
+---
+
+In the result `&` becomes `&` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`.
+
+```
+{{ htmlEscape "Hugo & Caddy > WordPress & Apache" }} → "Hugo & Caddy > WordPress & Apache"
+```
--- /dev/null
- godocref:
+---
+title: htmlUnescape
+linktitle: htmlUnescape
+description: Returns the given string with HTML escape codes un-escaped.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["htmlUnescape INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [htmlEscape]
+deprecated: false
+aliases: []
+---
+
+`htmlUnescape` returns the given string with HTML escape codes un-escaped.
+
+Remember to pass the output of this to `safeHTML` if fully un-escaped characters are desired. Otherwise, the output will be escaped again as normal.
+
+```
+{{ htmlUnescape "Hugo & Caddy > WordPress & Apache" }} → "Hugo & Caddy > WordPress & Apache"
+```
--- /dev/null
- godocref:
+---
+title: hugo
+linktitle: hugo
+description: The `hugo` function provides easy access to Hugo-related data.
-
+date: 2019-01-31
+publishdate: 2019-01-31
+lastmod: 2019-01-31
+keywords: []
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: ["hugo"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+`hugo` returns an instance that contains the following functions:
+
+hugo.Generator
+: `<meta>` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.63.2" />`
+
+hugo.Version
+: the current version of the Hugo binary you are using e.g. `0.63.2`
+
+
+`hugo` returns an instance that contains the following functions:
+
+hugo.Environment
+: the current running environment as defined through the `--environment` cli tag
+
+hugo.CommitHash
+: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
+
+hugo.BuildDate
+: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`
+
+hugo.IsExtended {{< new-in "0.83.0" >}}
+: whether this is the extended Hugo binary.
+
+hugo.IsProduction
+: returns true if `hugo.Environment` is set to the production environment
+
+{{% note "Use the Hugo Generator Tag" %}}
+We highly recommend using `hugo.Generator` in your website's `<head>`. `hugo.Generator` is included by default in all themes hosted on [themes.gohugo.io](https://themes.gohugo.io). The generator tag allows the Hugo team to track the usage and popularity of Hugo.
+{{% /note %}}
--- /dev/null
- godocref:
+---
+title: humanize
+linktitle:
+description: Returns the humanized version of an argument with the first letter capitalized.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,casing]
+signature: ["humanize INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [anchorize]
+deprecated: false
+aliases: []
+---
+
+If the input is either an int64 value or the string representation of an integer, humanize returns the number with the proper ordinal appended.
+
+
+```
+{{humanize "my-first-post"}} → "My first post"
+{{humanize "myCamelPost"}} → "My camel post"
+{{humanize "52"}} → "52nd"
+{{humanize 103}} → "103rd"
+```
--- /dev/null
- godocref:
+---
+title: i18n
+linktitle: i18n
+description: Translates a piece of content based on your i18n configuration files.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [internationalization,i18n,multilingual]
+signature: ["i18n KEY", "T KEY"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+This translates a piece of content based on your `i18n/en-US.yaml` (and similar) files. You can use the [go-i18n](https://github.com/nicksnyder/go-i18n) tools to manage your translations. The translations can exist in both the theme and at the root of your repository.
+
+```
+{{ i18n "translation_id" }}
+```
+
+{{% note "Alias `T`" %}}
+`T` is an alias to `i18n`. E.g. `{{ T "translation_id" }}`.
+{{% /note %}}
+
+For more information about string translations, see [Translation of Strings in Multilingual Mode][multistrings].
+
+[multistrings]: /content-management/multilingual/#translation-of-strings
--- /dev/null
- godocref:
+---
+title: Image Functions
+description: The images namespace provides a list of filters and other image related functions.
+date: 2017-02-01
+categories: [functions]
+aliases: [/functions/imageconfig/]
+menu:
+ docs:
+ parent: "functions"
+keywords: [images]
+toc: true
+---
+
+
+## Image Filters
+
+See [images.Filter](#filter) for how to apply these filters to an image.
+
+### Overlay
+
+{{< new-in "0.80.0" >}}
+
+{{% funcsig %}}
+images.Overlay SRC X Y
+{{% /funcsig %}}
+
+Overlay creates a filter that overlays the source image at position x y, e.g:
+
+
+```go-html-template
+{{ $logoFilter := (images.Overlay $logo 50 50 ) }}
+{{ $img := $img | images.Filter $logoFilter }}
+```
+
+A shorter version of the above, if you only need to apply the filter once:
+
+```go-html-template
+{{ $img := $img.Filter (images.Overlay $logo 50 50 )}}
+```
+
+The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`).
+
+### Brightness
+
+{{% funcsig %}}
+images.Brightness PERCENTAGE
+{{% /funcsig %}}
+
+Brightness creates a filter that changes the brightness of an image.
+The percentage parameter must be in range (-100, 100).
+
+### ColorBalance
+
+{{% funcsig %}}
+images.ColorBalance PERCENTAGERED PERCENTAGEGREEN PERCENTAGEBLUE
+{{% /funcsig %}}
+
+ColorBalance creates a filter that changes the color balance of an image.
+The percentage parameters for each color channel (red, green, blue) must be in range (-100, 500).
+
+### Colorize
+
+{{% funcsig %}}
+images.Colorize HUE SATURATION PERCENTAGE
+{{% /funcsig %}}
+
+Colorize creates a filter that produces a colorized version of an image.
+The hue parameter is the angle on the color wheel, typically in range (0, 360).
+The saturation parameter must be in range (0, 100).
+The percentage parameter specifies the strength of the effect, it must be in range (0, 100).
+
+### Contrast
+
+{{% funcsig %}}
+images.Contrast PERCENTAGE
+{{% /funcsig %}}
+
+Contrast creates a filter that changes the contrast of an image.
+The percentage parameter must be in range (-100, 100).
+
+### Gamma
+
+{{% funcsig %}}
+images.Gamma GAMMA
+{{% /funcsig %}}
+
+Gamma creates a filter that performs a gamma correction on an image.
+The gamma parameter must be positive. Gamma = 1 gives the original image.
+Gamma less than 1 darkens the image and gamma greater than 1 lightens it.
+
+### GaussianBlur
+
+{{% funcsig %}}
+images.GaussianBlur SIGMA
+{{% /funcsig %}}
+
+GaussianBlur creates a filter that applies a gaussian blur to an image.
+
+### Grayscale
+
+{{% funcsig %}}
+images.Grayscale
+{{% /funcsig %}}
+
+Grayscale creates a filter that produces a grayscale version of an image.
+
+### Hue
+
+{{% funcsig %}}
+images.Hue SHIFT
+{{% /funcsig %}}
+
+Hue creates a filter that rotates the hue of an image.
+The hue angle shift is typically in range -180 to 180.
+
+### Invert
+
+{{% funcsig %}}
+images.Invert
+{{% /funcsig %}}
+
+Invert creates a filter that negates the colors of an image.
+
+### Pixelate
+
+{{% funcsig %}}
+images.Pixelate SIZE
+{{% /funcsig %}}
+
+Pixelate creates a filter that applies a pixelation effect to an image.
+
+### Saturation
+
+{{% funcsig %}}
+images.Saturation PERCENTAGE
+{{% /funcsig %}}
+
+Saturation creates a filter that changes the saturation of an image.
+
+### Sepia
+
+{{% funcsig %}}
+images.Sepia PERCENTAGE
+{{% /funcsig %}}
+
+Sepia creates a filter that produces a sepia-toned version of an image.
+
+### Sigmoid
+
+{{% funcsig %}}
+images.Sigmoid MIDPOINT FACTOR
+{{% /funcsig %}}
+
+Sigmoid creates a filter that changes the contrast of an image using a sigmoidal function and returns the adjusted image.
+It's a non-linear contrast change useful for photo adjustments as it preserves highlight and shadow detail.
+
+### UnsharpMask
+
+{{% funcsig %}}
+images.UnsharpMask SIGMA AMOUNT THRESHOLD
+{{% /funcsig %}}
+
+UnsharpMask creates a filter that sharpens an image.
+The sigma parameter is used in a gaussian function and affects the radius of effect.
+Sigma must be positive. Sharpen radius roughly equals 3 * sigma.
+The amount parameter controls how much darker and how much lighter the edge borders become. Typically between 0.5 and 1.5.
+The threshold parameter controls the minimum brightness change that will be sharpened. Typically between 0 and 0.05.
+
+## Other Functions
+
+### Filter
+
+{{% funcsig %}}
+IMAGE | images.Filter FILTERS...
+{{% /funcsig %}}
+
+Can be used to apply a set of filters to an image:
+
+```go-html-template
+{{ $img := $img | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
+```
+
+Also see the [Filter Method](/content-management/image-processing/#filter).
+
+### ImageConfig
+
+Parses the image and returns the height, width, and color model.
+
+{{% funcsig %}}
+images.ImageConfig PATH
+{{% /funcsig %}}
+
+```go-html-template
+{{ with (imageConfig "favicon.ico") }}
+favicon.ico: {{.Width}} x {{.Height}}
+{{ end }}
+```
--- /dev/null
- godocref:
+---
+title: in
+linktitle:
+description: Checks if an element is in an array or slice--or a substring in a string---and returns a boolean.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["in SET ITEM"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+The elements supported are strings, integers and floats, although only float64 will match as expected.
+
+In addition, `in` can also check if a substring exists in a string.
+
+```
+{{ if in .Params.tags "Git" }}Follow me on GitHub!{{ end }}
+```
+
+
+```
+{{ if in "this string contains a substring" "substring" }}Substring found!{{ end }}
+```
--- /dev/null
- godocref: https://golang.org/pkg/text/template/#hdr-Functions
+---
+title: index
+linktitle: index
+description: Looks up the index(es) or key(s) of the data structure passed into it.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["index COLLECTION INDEXES", "index COLLECTION KEYS"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: [/functions/index/]
+needsexample: true
+---
+
+The `index` functions returns the result of indexing its first argument by the following arguments. Each indexed item must be a map or a slice, e.g.:
+
+```go-text-template
+{{ $slice := slice "a" "b" "c" }}
+{{ index $slice 1 }} => b
+{{ $map := dict "a" 100 "b" 200 }}
+{{ index $map "b" }} => 200
+```
+
+The function takes multiple indices as arguments, and this can be used to get nested values, e.g.:
+
+```go-text-template
+{{ $map := dict "a" 100 "b" 200 "c" (slice 10 20 30) }}
+{{ index $map "c" 1 }} => 20
+{{ $map := dict "a" 100 "b" 200 "c" (dict "d" 10 "e" 20) }}
+{{ index $map "c" "e" }} => 20
+```
+
++You may write multiple indices as a slice:
++
++```go-text-template
++{{ $map := dict "a" 100 "b" 200 "c" (dict "d" 10 "e" 20) }}
++{{ $slice := slice "c" "e" }}
++{{ index $map $slice }} => 20
++```
++
+## Example: Load Data from a Path Based on Front Matter Params
+
+Assume you want to add a `location = ""` field to your front matter for every article written in `content/vacations/`. You want to use this field to populate information about the location at the bottom of the article in your `single.html` template. You also have a directory in `data/locations/` that looks like the following:
+
+```
+.
+└── data
+ └── locations
+ ├── abilene.toml
+ ├── chicago.toml
+ ├── oslo.toml
+ └── provo.toml
+```
+
+Here is an example:
+
+{{< code-toggle file="data/locations/oslo" >}}
+website = "https://www.oslo.kommune.no"
+pop_city = 658390
+pop_metro = 1717900
+{{< /code-toggle >}}
+
+The example we will use will be an article on Oslo, whose front matter should be set to exactly the same name as the corresponding file name in `data/locations/`:
+
+```
+title = "My Norwegian Vacation"
+location = "oslo"
+```
+
+The content of `oslo.toml` can be accessed from your template using the following node path: `.Site.Data.locations.oslo`. However, the specific file you need is going to change according to the front matter.
+
+This is where the `index` function is needed. `index` takes 2 parameters in this use case:
+
+1. The node path
+2. A string corresponding to the desired data; e.g.—
+
+```
+{{ index .Site.Data.locations “oslo” }}
+```
+
+The variable for `.Params.location` is a string and can therefore replace `oslo` in the example above:
+
+```
+{{ index .Site.Data.locations .Params.location }}
+=> map[website:https://www.oslo.kommune.no pop_city:658390 pop_metro:1717900]
+```
+
+Now the call will return the specific file according to the location specified in the content's front matter, but you will likely want to write specific properties to the template. You can do this by continuing down the node path via dot notation (`.`):
+
+```
+{{ (index .Site.Data.locations .Params.location).pop_city }}
+=> 658390
+```
--- /dev/null
- godocref:
+---
+title: int
+linktitle: int
+description: Creates an `int` from the argument passed into the function.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,integers]
+signature: ["int INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+Useful for turning strings into numbers.
+
+```
+{{ int "123" }} → 123
+```
+
+{{% note "Usage Note" %}}
+If the input string is supposed to represent a decimal number, and if it has
+leading 0's, then those 0's will have to be removed before passing the string
+to the `int` function, else that string will be tried to be parsed as an octal
+number representation.
+
+The [`strings.TrimLeft` function](/functions/strings.trimleft/) can be used for
+this purpose.
+
+```
+{{ int ("0987" | strings.TrimLeft "0") }}
+{{ int ("00987" | strings.TrimLeft "0") }}
+```
+
+**Explanation**
+
+The `int` function eventually calls the `ParseInt` function from the Go library
+`strconv`.
+
+From its [documentation](https://golang.org/pkg/strconv/#ParseInt):
+
+> the base is implied by the string's prefix: base 16 for "0x", base 8 for "0",
+> and base 10 otherwise.
+{{% /note %}}
--- /dev/null
- godocref:
+---
+title: intersect
+linktitle: intersect
+description: Returns the common elements of two arrays or slices, in the same order as the first array.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [collections,intersect,union,complement,symdiff]
+signature: ["intersect SET1 SET2"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+An useful example is to use it as `AND` filters when combined with where:
+
+## AND filter in where query
+
+```
+{{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }}
+{{ $pages := $pages | union (where .Site.RegularPages "Params.pinned" true) }}
+{{ $pages := $pages | intersect (where .Site.RegularPages "Params.images" "!=" nil) }}
+```
+
+The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page params.
+
+See [union](/functions/union) for `OR`.
+
+
+[partials]: /templates/partials/
+[single]: /templates/single-page-templates/
--- /dev/null
- godocref:
+---
+title: .IsMenuCurrent
+description:
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [menus]
+signature: ["PAGE.IsMenuCurrent MENU MENUENTRY"]
+workson: [menus]
+hugoversion:
+relatedfuncs: ["HasMenuCurrent"]
+deprecated: false
+draft: false
+aliases: []
+needsexample: true
+---
+
+`.IsMenuCurrent` is a method in `Page` object returning a _boolean_ value. It
+returns `true` if the PAGE is the same object as the `.Page` in MENUENTRY in a
+given MENU.
+
+You can find its example use in [menu templates](/templates/menu-templates/).
--- /dev/null
- godocref:
+---
+title: isset
+linktitle: isset
+description: Returns true if the parameter is set.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["isset COLLECTION INDEX", "isset COLLECTION KEY"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+Takes either a slice, array, or channel and an index or a map and a key as input.
+
+```
+{{ if isset .Params "project_url" }} {{ index .Params "project_url" }}{{ end }}
+```
+
+{{% warning %}}
+All site-level configuration keys are stored as lower case. Therefore, a `myParam` key-value set in your [site configuration file](/getting-started/configuration/) needs to be accessed with `{{if isset .Site.Params "myparam"}}` and *not* with `{{if isset .Site.Params "myParam"}}`. Note that you can still access the same config key with `.Site.Params.myParam` *or* `.Site.Params.myparam`, for example, when using [`with`](/functions/with).
+This restriction also applies when accessing page-level front matter keys from within [shortcodes](/content-management/shortcodes/).
+{{% /warning %}}
--- /dev/null
- godocref:
+---
+title: jsonify
+linktitle: jsonify
+description: Encodes a given object to JSON.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2020-04-13
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,json]
+signature: ["jsonify INPUT", "jsonify OPTIONS INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [plainify]
+deprecated: false
+aliases: []
+---
+
+Jsonify encodes a given object to JSON.
+
+To customize the printing of the JSON, pass a dictionary of options as the first
+argument. Supported options are "prefix" and "indent". Each JSON element in
+the output will begin on a new line beginning with *prefix* followed by one or
+more copies of *indent* according to the indentation nesting.
+
+
+```
+{{ dict "title" .Title "content" .Plain | jsonify }}
+{{ dict "title" .Title "content" .Plain | jsonify (dict "indent" " ") }}
+{{ dict "title" .Title "content" .Plain | jsonify (dict "prefix" " " "indent" " ") }}
+```
+
+See also the `.PlainWords`, `.Plain`, and `.RawContent` [page variables][pagevars].
+
+[pagevars]: /variables/page/
--- /dev/null
- godocref: ""
+---
+title: lang.Merge
+description: "Merge missing translations from other languages."
+date: 2018-03-16
+categories: [functions]
+keywords: [multilingual]
+menu:
+ docs:
+ parent: "functions"
+toc: false
+signature: ["lang.Merge FROM TO"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+comments:
+---
+
+As an example:
+
+```bash
+{{ $pages := .Site.RegularPages | lang.Merge $frSite.RegularPages | lang.Merge $enSite.RegularPages }}
+```
+
+Will "fill in the gaps" in the current site with, from left to right, content from the French site, and lastly the English.
+
+
+A more practical example is to fill in the missing translations from the other languages:
+
+```bash
+{{ $pages := .Site.RegularPages }}
+{{ range .Site.Home.Translations }}
+{{ $pages = $pages | lang.Merge .Site.RegularPages }}
+{{ end }}
+ ```
--- /dev/null
- godocref:
+---
+title: last
+linktitle: last
+description: "slices an array to only the last <em>N</em>th elements."
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: []
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: ["last INDEX COLLECTION"]
+workson: [lists, taxonomies, terms, groups]
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+```
+{{ range last 10 .Pages }}
+ {{ .Render "summary" }}
+{{ end }}
+```
--- /dev/null
- godocref:
+---
+title: le
+linktitle: le
+description: Returns the boolean truth of arg1 <= arg2.
+date: 2017-07-26
+publishdate: 2017-07-26
+lastmod: 2017-07-26
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [operators,logic]
+signature: ["le ARG1 ARG2"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{ if le 5 10 }}true{{ end }}
+```
--- /dev/null
- godocref: https://golang.org/pkg/builtin/#len
+---
+title: len
+linktitle: len
+description: Returns the length of a variable according to its type.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-04-18
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["len INPUT"]
+workson: [lists,taxonomies,terms]
+hugoversion:
+relatedfuncs: []
+deprecated: false
+toc: false
+aliases: []
+---
+
+`len` is a built-in function in Go that returns the length of a variable according to its type. From the Go documentation:
+
+> Array: the number of elements in v.
+>
+> Pointer to array: the number of elements in *v (even if v is nil).
+>
+> Slice, or map: the number of elements in v; if v is nil, len(v) is zero.
+>
+> String: the number of bytes in v.
+>
+> Channel: the number of elements queued (unread) in the channel buffer; if v is nil, len(v) is zero.
+
+`len` is also considered a [fundamental function for Hugo templating][].
+
+## `len` Example 1: Longer Headings
+
+You may want to append a class to a heading according to the length of the string therein. The following templating checks to see if the title's length is greater than 80 characters and, if so, adds a `long-title` class to the `<h1>`:
+
+{{< code file="check-title-length.html" >}}
+<header>
+ <h1{{if gt (len .Title) 80}} class="long-title"{{end}}>{{.Title}}</h1>
+</header>
+{{< /code >}}
+
+## `len` Example 2: Counting Pages with `where`
+
+The following templating uses [`where`][] in conjunction with `len` to
+figure out the total number of content pages in a `posts` [section][]:
+
+{{< code file="how-many-posts.html" >}}
+{{ $posts := (where .Site.RegularPages "Section" "==" "posts") }}
+{{ $postCount := len $posts }}
+{{< /code >}}
+
+Note the use of `.RegularPages`, a [site variable][] that counts all regular content pages but not the `_index.md` pages used to add front matter and content to [list templates][].
+
+
+[fundamental function for Hugo templating]: /templates/introduction/
+[list templates]: /templates/lists/
+[section]: /content-management/sections/
+[site variable]: /variables/site/
+[`where`]: /functions/where/
--- /dev/null
- godocref:
+---
+title: lower
+linktitle: lower
+description: Converts all characters in the provided string to lowercase.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,casing]
+signature: ["lower INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+```
+{{lower "BatMan"}} → "batman"
+```
--- /dev/null
- godocref:
+---
+title: lt
+linktitle: lt
+description: Returns the boolean truth of arg1 < arg2.
+date: 2017-07-26
+publishdate: 2017-07-26
+lastmod: 2017-07-26
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [operators,logic]
+signature: ["lt ARG1 ARG2"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{ if lt 5 10 }}true{{ end }}
+```
--- /dev/null
- godocref:
+---
+title: markdownify
+linktitle: markdownify
+description: Runs the provided string through the Markdown processor.
- [Render Hooks]: /getting-started/configuration-markup/#markdown-render-hooks
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: [markdown,content]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+signature: ["markdownify INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{ .Title | markdownify }}
+```
+
+*Note*: if you need [Render Hooks][], which `markdownify` doesn't currently
+support, use [.RenderString](/functions/renderstring/) instead.
+
++[Render Hooks]: /getting-started/configuration-markup/#markdown-render-hooks
--- /dev/null
- godocref:
+---
+title: Math
+description: Hugo provides mathematical operators in templates.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2020-02-23
+keywords: [math, operators]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: []
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+| Function | Description | Example |
+|--------------|-----------------------------------------------------------------------------|----------------------------------|
+| `add` | Adds two numbers. | `{{add 1 2}}` → `3` |
+| | *If one of the numbers is a float, the result is a float.* | `{{add 1.1 2}}` → `3.1` |
+| `sub` | Subtracts two numbers. | `{{sub 3 2}}` → `1` |
+| | *If one of the numbers is a float, the result is a float.* | `{{sub 3 2.5}}` → `0.5` |
+| `mul` | Multiplies two numbers. | `{{mul 2 3}}` → `6` |
+| | *If one of the numbers is a float, the result is a float.* | `{{mul 2 3.1}}` → `6.2` |
+| `div` | Divides two numbers. | `{{div 6 3}}` → `2` |
+| | | `{{div 6 4}}` → `1` |
+| | *If one of the numbers is a float, the result is a float.* | `{{div 6 4.0}}` → `1.5` |
+| `mod` | Modulus of two integers. | `{{mod 15 3}}` → `0` |
+| `modBool` | Boolean of modulus of two integers. Evaluates to `true` if result equals 0. | `{{modBool 15 3}}` → `true` |
+| `math.Ceil` | Returns the least integer value greater than or equal to the given number. | `{{math.Ceil 2.1}}` → `3` |
+| `math.Floor` | Returns the greatest integer value less than or equal to the given number. | `{{math.Floor 1.9}}` → `1` |
+| `math.Log` | Returns the natural logarithm of the given number. | `{{math.Log 42}}` → `3.737` |
+| `math.Max` | Returns the greater of two numbers. | `{{math.Max 1 2}}` → `2` |
+| `math.Min` | Returns the smaller of two numbers. | `{{math.Min 1 2}}` → `1` |
+| `math.Pow` | Returns the first number raised to the power of the second number. | `{{math.Pow 2 3}}` → `8` |
+| `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{math.Round 1.5}}` → `2` |
+| `math.Sqrt` | Returns the square root of the given number. | `{{math.Sqrt 81}}` → `9` |
--- /dev/null
- godocref:
+---
+title: md5
+linktitle: md5
+description: hashes the given input and returns its MD5 checksum.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["md5 INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [sha]
+deprecated: false
+aliases: []
+---
+
+```
+{{ md5 "Hello world, gophers!" }}
+<!-- returns the string "b3029f756f98f79e7f1b7f1d1f0dd53b" -->
+```
+
+This can be useful if you want to use [Gravatar](https://en.gravatar.com/) for generating a unique avatar:
+
+```
+<img src="https://www.gravatar.com/avatar/{{ md5 "your@email.com" }}?s=100&d=identicon">
+```
--- /dev/null
- godocref:
+---
+title: ne
+linktitle: ne
+description: Returns the boolean truth of arg1 != arg2.
+date: 2017-07-26
+publishdate: 2017-07-26
+lastmod: 2017-07-26
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [operators,logic]
+signature: ["ne ARG1 ARG2"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{ if ne .Section "blog" }}current{{ end }}
+```
--- /dev/null
- godocref: https://godoc.org/time#Time
+---
+title: now
+linktitle: now
+description: Returns the current local time
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-04-30
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [dates,time]
+signature: ["now"]
+workson: []
+hugoversion:
+relatedfuncs: [Unix,dateFormat]
+deprecated: false
+aliases: []
+---
+
+See [`time.Time`](https://godoc.org/time#Time).
+
+For example, building your site on June 24, 2017, with the following templating:
+
+```
+<div>
+ <small>© {{ now.Format "2006"}}</small>
+</div>
+```
+
+would produce the following:
+
+```
+<div>
+ <small>© 2017</small>
+</div>
+```
+
+The above example uses the [`.Format` function](/functions/format), which page includes a full listing of date formatting using Go's layout string.
+
+{{% note %}}
+Older Hugo themes may still be using the obsolete Page’s `.Now` (uppercase with leading dot), which causes build error that looks like the following:
+
+ ERROR ... Error while rendering "..." in "...": ...
+ executing "..." at <.Now.Format>:
+ can't evaluate field Now in type *hugolib.PageOutput
+
+Be sure to use `now` (lowercase with _**no**_ leading dot) in your templating.
+{{% /note %}}
--- /dev/null
- godocref:
+---
+title: os.Stat
+description: Gets a file information of a given path.
+date: 2018-08-07
+publishdate: 2018-08-07
+lastmod: 2018-08-07
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [files]
+signature: ["os.Stat PATH"]
+workson: []
+hugoversion:
+relatedfuncs: [readDir]
+deprecated: false
+aliases: []
+---
+
+If your current project working directory has a single file named `README.txt` (30 bytes):
+```
+{{ $stat := os.Stat "README.txt" }}
+{{ $stat.Name }} → "README.txt"
+{{ $stat.Size }} → 30
+```
+
+Function [`os.Stat`][Stat] returns [`os.FileInfo`][osfileinfo].
+For further information of `os.FileInfo`, see [golang page][osfileinfo].
+
+
+[Stat]: /functions/os.Stat/
+[osfileinfo]: https://golang.org/pkg/os/#FileInfo
--- /dev/null
- godocref:
+---
+title: .Param
+description: Calls page or site variables into your template.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-04-30
+keywords: ["front matter"]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: [".Param KEY"]
+workson: []
+hugoversion:
+relatedfuncs: [default]
+deprecated: false
+draft: false
+aliases: []
+---
+
+In Hugo, you can declare [site-wide params][sitevars] (i.e. in your [configuration][]), as well as params for [individual pages][pagevars].
+
+A common use case is to have a general value for the site and a more specific value for some of the pages (e.g., an image).
+
+You can use the `.Param` method to call these values into your template. The following will first look for an `image` param in a specific content's [front matter][]. If not found, Hugo will look for an `image` param in your site's configuration:
+
+```
+$.Param "image"
+```
+
+{{% note %}}
+The `Param` method may not consider empty strings in a content's front matter as "not found." If you are setting preconfigured front matter fields to empty strings using Hugo's archetypes, it may be best to use the [`default` function](/functions/default/) instead of `Param`. See the [related issue on GitHub](https://github.com/gohugoio/hugo/issues/3366).
+{{% /note %}}
+
+
+[configuration]: /getting-started/configuration/
+[front matter]: /content-management/front-matter/
+[pagevars]: /variables/page/
+[sitevars]: /variables/site/
--- /dev/null
- godocref:
+---
+title: partialCached
+linktitle: partialCached
+description: Allows for caching of partials that do not need to be re-rendered on every invocation.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [performance]
+signature: ["partialCached LAYOUT INPUT [VARIANT...]"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+The `partialCached` template function can offer significant performance gains for complex templates that don't need to be re-rendered on every invocation.
+
+**Note:** Each Site (or language) has its own `partialCached` cache, so each site will execute a partial once.
+
+Here is the simplest usage:
+
+```
+{{ partialCached "footer.html" . }}
+```
+
+You can also pass additional parameters to `partialCached` to create *variants* of the cached partial. For example, if you have a complex partial that should be identical when rendered for pages within the same section, you could use a variant based upon section so that the partial is only rendered once per section:
+
+{{< code file="partial-cached-example.html" >}}
+{{ partialCached "footer.html" . .Section }}
+{{< /code >}}
+
+If you need to pass additional parameters to create unique variants, you can pass as many variant parameters as you need:
+
+```
+{{ partialCached "footer.html" . .Params.country .Params.province }}
+```
+
+Note that the variant parameters are not made available to the underlying partial template. They are only use to create a unique cache key. Since Hugo `0.61.0` you can use any object as cache key(s), not just strings.
+
+
+> See also the [The Full Partial Series Part 1: Caching!](https://regisphilibert.com/blog/2019/12/hugo-partial-series-part-1-caching-with-partialcached/)
--- /dev/null
- godocref:
+---
+title: path.Base
+description: Base returns the last element of a path.
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [path, base]
+signature: ["path.Base PATH"]
+workson: []
+hugoversion: "0.40"
+relatedfuncs: [path.Dir, path.Ext, path.Split]
+deprecated: false
+---
+
+`path.Base` returns the last element of `PATH`.
+
+If `PATH` is empty, `.` is returned.
+
+**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
+
+```
+{{ path.Base "a/news.html" }} → "news.html"
+{{ path.Base "news.html" }} → "news.html"
+{{ path.Base "a/b/c" }} → "c"
+{{ path.Base "/x/y/z/" }} → "z"
+```
--- /dev/null
- godocref:
+---
+title: path.Dir
+description: Dir returns all but the last element of a path.
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [path, dir]
+signature: ["path.Dir PATH"]
+workson: []
+hugoversion: "0.40"
+relatedfuncs: [path.Base, path.Ext, path.Split]
+deprecated: false
+---
+
+`path.Dir` returns all but the last element of `PATH`, typically `PATH`'s directory.
+
+The returned path will never end in a slash.
+If `PATH` is empty, `.` is returned.
+
+**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
+
+```
+{{ path.Dir "a/news.html" }} → "a"
+{{ path.Dir "news.html" }} → "."
+{{ path.Dir "a/b/c" }} → "a/b"
+{{ path.Dir "/x/y/z" }} → "/x/y"
+```
--- /dev/null
- godocref:
+---
+title: path.Ext
+description: Ext returns the file name extension of a path.
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [path, ext, extension]
+signature: ["path.Ext PATH"]
+workson: []
+hugoversion: "0.40"
+relatedfuncs: [path.Base, path.Dir, path.Split]
+deprecated: false
+---
+
+`path.Ext` returns the file name extension `PATH`.
+
+The extension is the suffix beginning at the final dot in the final slash-separated element `PATH`;
+it is empty if there is no dot.
+
+**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
+
+```
+{{ path.Ext "a/b/c/news.html" }} → ".html"
+```
--- /dev/null
- godocref:
+---
+title: path.Join
+description: Join path elements into a single path.
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [path, join]
+signature: ["path.Join ELEMENT..."]
+workson: []
+hugoversion: "0.39"
+relatedfuncs: [path.Split]
+deprecated: false
+---
+
+`path.Join` joins path elements into a single path, adding a separating slash if necessary.
+All empty strings are ignored.
+
+**Note:** All path elements on Windows are converted to slash ('/') separators.
+
+```
+{{ path.Join "partial" "news.html" }} → "partial/news.html"
+{{ path.Join "partial/" "news.html" }} → "partial/news.html"
+{{ path.Join "foo/baz" "bar" }} → "foo/baz/bar"
+```
--- /dev/null
- godocref:
+---
+title: path.Split
+description: Split path immediately following the final slash.
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [path, split]
+signature: ["path.Split PATH"]
+workson: []
+hugoversion: "0.39"
+relatedfuncs: [path.Split]
+deprecated: false
+---
+
+`path.Split` splits `PATH` immediately following the final slash, separating it into a directory and a base component.
+
+The returned values have the property that `PATH` = `DIR`+`BASE`.
+If there is no slash in `PATH`, it returns an empty directory and the base is set to `PATH`.
+
+**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
+
+```
+{{ $dirFile := path.Split "a/news.html" }} → $dirFile.Dir → "a/", $dirFile.File → "news.html"
+{{ $dirFile := path.Split "news.html" }} → $dirFile.Dir → "", $dirFile.File → "news.html"
+{{ $dirFile := path.Split "a/b/c" }} → $dirFile.Dir → "a/b/", $dirFile.File → "c"
+```
--- /dev/null
- godocref:
+---
+title: plainify
+linktitle: plainify
+description: Strips any HTML and returns the plain text version of the provided string.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-04-30
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["plainify INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [jsonify]
+deprecated: false
+aliases: []
+---
+
+```
+{{ "<b>BatMan</b>" | plainify }} → "BatMan"
+```
+
+See also the `.PlainWords`, `.Plain`, and `.RawContent` [page variables][pagevars].
+
+[pagevars]: /variables/page/
--- /dev/null
- godocref:
+---
+title: pluralize
+linktitle: pluralize
+description: Pluralizes the given word according to a set of common English pluralization rules
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["pluralize INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+```
+{{ "cat" | pluralize }} → "cats"
+```
--- /dev/null
- godocref: https://golang.org/pkg/fmt/
+---
+title: print
+linktitle: print
+description: Prints the default representation of the given arguments using the standard `fmt.Print` function.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["print INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+See [the go doc](https://golang.org/pkg/fmt/) for additional information.
+
+```
+{{ print "foo" }} → "foo"
+{{ print "foo" "bar" }} → "foobar"
+{{ print (slice 1 2 3) }} → [1 2 3]
+```
--- /dev/null
- godocref: https://golang.org/pkg/fmt/
+---
+title: printf
+linktitle: printf
+description: Formats a string using the standard `fmt.Sprintf` function.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["printf FORMAT INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+See [the go doc](https://golang.org/pkg/fmt/) for additional information.
+
+```
+{{ i18n ( printf "combined_%s" $var ) }}
+```
+
+```
+{{ printf "formatted %.2f" 3.1416 }}
+```
--- /dev/null
- godocref: https://golang.org/pkg/fmt/
+---
+title: println
+linktitle: println
+description: Prints the default representation of the given argument using the standard `fmt.Print` function and enforces a linebreak.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["println INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+See [the go doc](https://golang.org/pkg/fmt/) for additional information. `\n` denotes the linebreak but isn't printed in the templates as seen below:
+
+```
+{{ println "foo" }} → "foo\n"
+```
--- /dev/null
- godocref:
+---
+title: querify
+linktitle: querify
+description: Takes a set or slice of key-value pairs and returns a query string to be appended to URLs.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [urls]
+signature: ["querify KEY VALUE [KEY VALUE]...", "querify COLLECTION"]
+hugoversion:
+deprecated: false
+workson: []
+relatedfuncs: []
+aliases: []
+---
+
+`querify` takes a set or slice of key-value pairs and returns a [query string](https://en.wikipedia.org/wiki/Query_string) that can be appended to a URL.
+
+The following examples create a link to a search results page on Google.
+
+```go-html-template
+<a href="https://www.google.com?{{ (querify "q" "test" "page" 3) | safeURL }}">Search</a>
+
+{{ $qs := slice "q" "test" "page" 3 }}
+<a href="https://www.google.com?{{ (querify $qs) | safeURL }}">Search</a>
+```
+
+Both of these examples render the following HTML:
+
+```html
+<a href="https://www.google.com?page=3&q=test">Search</a>
+```
--- /dev/null
- godocref:
+---
+title: range
+linktitle:
+description: Iterates over a map, array, or slice.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [iteration]
+signature: ["range COLLECTION"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+Just like in the Go programming language, Go and Hugo templates make heavy use of `range` to iterate over a map, array or slice. Other templating languages use a foreach for the equivalent functionality.
+
+`range` is fundamental to templating in Hugo. (See the [Introduction to Hugo Templates](/templates/introduction/) for more examples.)
--- /dev/null
- godocref:
+---
+title: readDir
+description: Gets a directory listing from a directory relative to the current working directory.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [files]
+signature: ["readDir PATH"]
+workson: []
+hugoversion:
+relatedfuncs: [readFile]
+deprecated: false
+aliases: []
+---
+
+If your current project working directory has a single file named `README.txt`:
+
+```
+{{ range (readDir ".") }}{{ .Name }}{{ end }} → "README.txt"
+```
+
+For more information on using `readDir` and `readFile` in your templates, see [Local File Templates][local].
+
+[local]: /templates/files/
--- /dev/null
- godocref:
+---
+title: readFile
+description: Reads a file from disk relative to the current project working directory and returns a string.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-04-30
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [files]
+signature: ["readFile PATH"]
+workson: []
+hugoversion:
+relatedfuncs: [readDir]
+deprecated: false
+aliases: []
+---
+
+Note that the filename must be relative to the current project working directory, or the project's `/content` folder.
+
+So, if you have a file with the name `README.txt` in the root of your project with the content `Hugo Rocks!`:
+
+```
+{{readFile "README.txt"}} → "Hugo Rocks!"
+```
+
+If you receive a "file doesn't exist" error with a path listed, do take note that the path is the last one checked by the function, and may not accurately reflect your target. You should generally double-check your path for mistakes.
+
+For more information on using `readDir` and `readFile` in your templates, see [Local File Templates][local].
+
+[local]: /templates/files/
--- /dev/null
- godocref:
+---
+title: ref
+linktitle: ref
+description: Returns the absolute permalink to a page.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2020-09-05
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [cross references, anchors]
+signature: ["ref . PAGE"]
+workson: []
+hugoversion:
+relatedfuncs: [relref]
+deprecated: false
+aliases: []
+---
+
+This function takes two parameters:
+
+- The context of the page from which to resolve relative paths, typically the current page (`.`)
+- The path to a page, with or without a file extension, with or without an anchor. A path without a leading `/` is first resolved relative to the given context, then to the remainder of the site.
+
+```go-html-template
+{{ ref . "about" }}
+{{ ref . "about#anchor" }}
+{{ ref . "about.md" }}
+{{ ref . "about.md#anchor" }}
+{{ ref . "#anchor" }}
+{{ ref . "/blog/my-post" }}
+{{ ref . "/blog/my-post.md" }}
+```
+
+To return the absolute permalink to another language version of a page:
+
+```go-html-template
+{{ ref . (dict "path" "about.md" "lang" "fr") }}
+```
+
+To return the absolute permalink to another Output Format of a page:
+
+```go-html-template
+{{ ref . (dict "path" "about.md" "outputFormat" "rss") }}
+```
+
+Hugo emits an error or warning if the page cannot be uniquely resolved. The error behavior is configurable; see [Ref and RelRef Configuration](/content-management/cross-references/#ref-and-relref-configuration).
+
+This function is used by Hugo's built-in [`ref`](/content-management/shortcodes/#ref-and-relref) shortcode. For a detailed explanation of how to leverage this shortcode for content management, see [Links and Cross References](/content-management/cross-references/).
--- /dev/null
- godocref:
+---
+title: reflect.IsMap
+description: Reports if a value is a map.
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [reflect, reflection, kind]
+signature: ["reflect.IsMap INPUT"]
+workson: []
+hugoversion: "v0.53"
+relatedfuncs: [reflect.IsSlice]
+deprecated: false
+---
+
+`reflect.IsMap` reports if `VALUE` is a map. Returns a boolean.
+
+```
+{{ reflect.IsMap (dict "key" "value") }} → true
+{{ reflect.IsMap "yo" }} → false
+```
--- /dev/null
- godocref:
+---
+title: reflect.IsSlice
+description: Reports if a value is a slice.
+date: 2018-11-28
+publishdate: 2018-11-28
+lastmod: 2018-11-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [reflect, reflection, kind]
+signature: ["reflect.IsSlice INPUT"]
+workson: []
+hugoversion: "0.53"
+relatedfuncs: [reflect.IsMap]
+deprecated: false
+---
+
+`reflect.IsSlice` reports if `VALUE` is a slice. Returns a boolean.
+
+```
+{{ reflect.IsSlice (slice 1 2 3) }} → true
+{{ reflect.IsSlice "yo" }} → false
+```
--- /dev/null
- godocref:
+---
+title: relLangURL
+description: Adds the relative URL with correct language prefix according to site configuration for multilingual.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: [multilingual,i18n,urls]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+signature: ["relLangURL INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+`absLangURL` and `relLangURL` functions are similar to their [`absURL`](/functions/absurl/) and [`relURL`](/functions/relurl/) relatives but will add the correct language prefix when the site is configured with more than one language. (See [Configuring Multilingual][multiliconfig].)
+
+So for a site `baseURL` set to `https://example.com/hugo/` and the current language is `en`:
+
+```
+{{ "blog/" | absLangURL }} → "https://example.com/hugo/en/blog/"
+{{ "blog/" | relLangURL }} → "/hugo/en/blog/"
+```
+
+[multiliconfig]: /content-management/multilingual/#configuring-multilingual-mode
--- /dev/null
- godocref:
+---
+title: relref
+linktitle: relref
+description: Returns the relative permalink to a page.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2020-09-05
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [cross references, anchors]
+signature: ["relref . PAGE"]
+workson: []
+hugoversion:
+relatedfuncs: [ref]
+deprecated: false
+aliases: []
+---
+
+This function takes two parameters:
+
+- The context of the page from which to resolve relative paths, typically the current page (`.`)
+- The path to a page, with or without a file extension, with or without an anchor. A path without a leading `/` is first resolved relative to the given context, then to the remainder of the site.
+
+```go-html-template
+{{ relref . "about" }}
+{{ relref . "about#anchor" }}
+{{ relref . "about.md" }}
+{{ relref . "about.md#anchor" }}
+{{ relref . "#anchor" }}
+{{ relref . "/blog/my-post" }}
+{{ relref . "/blog/my-post.md" }}
+```
+
+The permalink returned is relative to the protocol+host portion of the baseURL specified in the site configuration. For example:
+
+Code|baseURL|Permalink
+:--|:--|:--
+`{{ relref . "/about" }}`|`http://example.org/`|`/about/`
+`{{ relref . "/about" }}`|`http://example.org/x/`|`/x/about/`
+
+To return the relative permalink to another language version of a page:
+
+```go-html-template
+{{ relref . (dict "path" "about.md" "lang" "fr") }}
+```
+
+To return the relative permalink to another Output Format of a page:
+
+```go-html-template
+{{ relref . (dict "path" "about.md" "outputFormat" "rss") }}
+```
+
+Hugo emits an error or warning if the page cannot be uniquely resolved. The error behavior is configurable; see [Ref and RelRef Configuration](/content-management/cross-references/#ref-and-relref-configuration).
+
+This function is used by Hugo's built-in [`relref`](/content-management/shortcodes/#ref-and-relref) shortcode. For a detailed explanation of how to leverage this shortcode for content management, see [Links and Cross References](/content-management/cross-references/).
--- /dev/null
- godocref:
+---
+title: relURL
+description: Creates a baseURL-relative URL.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [urls]
+signature: ["relURL INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [absURL]
+deprecated: false
+aliases: []
+---
+
+Both `absURL` and `relURL` consider the configured value of `baseURL` in your site's [`config` file][configuration]. Given a `baseURL` set to `https://example.com/hugo/`:
+
+```
+{{ "mystyle.css" | absURL }} → "https://example.com/hugo/mystyle.css"
+{{ "mystyle.css" | relURL }} → "/hugo/mystyle.css"
+{{ "http://gohugo.io/" | relURL }} → "http://gohugo.io/"
+{{ "http://gohugo.io/" | absURL }} → "http://gohugo.io/"
+```
+
+The last two examples may look strange but can be very useful. For example, the following shows how to use `absURL` in [JSON-LD structured data for SEO][jsonld] where some of your images for a piece of content may or may not be hosted locally:
+
+{{< code file="layouts/partials/schemaorg-metadata.html" download="schemaorg-metadata.html" >}}
+<script type="application/ld+json">
+{
+ "@context" : "http://schema.org",
+ "@type" : "BlogPosting",
+ "image" : {{ apply .Params.images "absURL" "." }}
+}
+</script>
+{{< /code >}}
+
+The above uses the [apply function][] and also exposes how the Go template parser JSON-encodes objects inside `<script>` tags. See [the safeJS template function][safejs] for examples of how to tell Hugo not to escape strings inside of such tags.
+
+{{% note "Ending Slash" %}}
+`absURL` and `relURL` are smart about missing slashes, but they will *not* add a closing slash to a URL if it is not present.
+{{% /note %}}
+
+[apply function]: /functions/apply/
+[configuration]: /getting-started/configuration/
+[jsonld]: https://developers.google.com/search/docs/guides/intro-structured-data
+[safejs]: /functions/safejs
--- /dev/null
- godocref:
+---
+title: .Render
+description: Takes a view to apply when rendering content.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [views]
+signature: [".Render LAYOUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+The view is an alternative layout and should be a file name that points to a template in one of the locations specified in the documentation for [Content Views](/templates/views).
+
+This function is only available when applied to a single piece of content within a [list context][].
+
+This example could render a piece of content using the content view located at `/layouts/_default/summary.html`:
+
+```
+{{ range .Pages }}
+ {{ .Render "summary"}}
+{{ end }}
+```
+
+[list context]: /templates/lists/
--- /dev/null
- godocref:
+---
+title: replace
+description: Replaces all occurrences of the search string with the replacement string.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2020-09-07
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["strings.Replace INPUT OLD NEW [LIMIT]", "replace INPUT OLD NEW [LIMIT]"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+Replace returns a copy of `INPUT` with all occurrences of `OLD` replaced with `NEW`.
+The number of replacements can be limited with an optional `LIMIT` parameter.
+
+```
+`{{ replace "Batman and Robin" "Robin" "Catwoman" }}`
+→ "Batman and Catwoman"
+
+{{ replace "aabbaabb" "a" "z" 2 }} → "zzbbaabb"
+```
--- /dev/null
- godocref:
+---
+title: replaceRE
+description: Replaces all occurrences of a regular expression with the replacement pattern.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2020-09-07
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [regex]
+signature: ["strings.ReplaceRE PATTERN REPLACEMENT INPUT [LIMIT]", "replaceRE PATTERN REPLACEMENT INPUT [LIMIT]"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+`strings.ReplaceRE` returns a copy of `INPUT`, replacing all matches of the regular
+expression `PATTERN` with the replacement text `REPLACEMENT`.
+The number of replacements can be limited with an optional `LIMIT` parameter.
+
+```
+{{ replaceRE "^https?://([^/]+).*" "$1" "http://gohugo.io/docs" }}` → "gohugo.io"
+{{ "http://gohugo.io/docs" | replaceRE "^https?://([^/]+).*" "$1" }}` → "gohugo.io"
+{{ replaceRE "a+b" "X" "aabbaabbab" 1 }} → "Xbaabbab"
+```
+
+{{% note %}}
+Hugo uses Go's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
+
+If you are just learning RegEx, or at least Go's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
+{{% /note %}}
--- /dev/null
- godocref: https://golang.org/src/html/template/content.go?s=919:929#L15
+---
+title: safeCSS
+description: Declares the provided string as a known "safe" CSS string.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-26
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [style,css,strings]
+signature: ["safeCSS INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [safeHTML,safeHTMLAttr,]
+deprecated: false
+aliases: []
+---
+
+In this context, *safe* means CSS content that matches any of the following:
+
+1. The CSS3 stylesheet production, such as `p { color: purple }`.
+2. The CSS3 rule production, such as `a[href=~"https:"].foo#bar`.
+3. CSS3 declaration productions, such as `color: red; margin: 2px`.
+4. The CSS3 value production, such as `rgba(0, 0, 255, 127)`.
+
+Example: Given `style = "color: red;"` defined in the front matter of your `.md` file:
+
+* <span class="good">`<p style="{{ .Params.style | safeCSS }}">…</p>` → `<p style="color: red;">…</p>`</span>
+* <span class="bad">`<p style="{{ .Params.style }}">…</p>` → `<p style="ZgotmplZ">…</p>`</span>
+
+{{% note "ZgotmplZ" %}}
+"ZgotmplZ" is a special value that indicates that unsafe content reached a CSS or URL context.
+{{% /note %}}
--- /dev/null
- godocref: https://golang.org/src/html/template/content.go?s=1374:1385#L25
+---
+title: safeHTML
+# linktitle:
+description: Declares a provided string as a "safe" HTML document to avoid escaping by Go templates.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["safeHTML INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+It should not be used for HTML from a third-party, or HTML with unclosed tags or comments.
+
+Given a site-wide [`config.toml`][config] with the following `copyright` value:
+
+{{< code-toggle file="config" >}}
+copyright = "© 2015 Jane Doe. <a href=\"https://creativecommons.org/licenses/by/4.0/\">Some rights reserved</a>."
+{{< /code-toggle >}}
+
+`{{ .Site.Copyright | safeHTML }}` in a template would then output:
+
+```
+© 2015 Jane Doe. <a href="https://creativecommons.org/licenses/by/4.0/">Some rights reserved</a>.
+```
+
+However, without the `safeHTML` function, html/template assumes `.Site.Copyright` to be unsafe and therefore escapes all HTML tags and renders the whole string as plain text:
+
+```
+<p>© 2015 Jane Doe. <a href="https://creativecommons.org/licenses by/4.0/">Some rights reserved</a>.</p>
+```
+
+[config]: /getting-started/configuration/
--- /dev/null
- godocref: https://golang.org/src/html/template/content.go?s=1661:1676#L33
+---
+title: safeHTMLAttr
+# linktitle: safeHTMLAttr
+description: Declares the provided string as a safe HTML attribute.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["safeHTMLAttr INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+Example: Given a site-wide `config.toml` that contains this menu entry:
+
+{{< code-toggle file="config" >}}
+[[menu.main]]
+ name = "IRC: #golang at freenode"
+ url = "irc://irc.freenode.net/#golang"
+{{< /code-toggle >}}
+
+* <span class="bad">`<a href="{{ .URL }}">` → `<a href="#ZgotmplZ">`</span>
+* <span class="good">`<a {{ printf "href=%q" .URL | safeHTMLAttr }}>` → `<a href="irc://irc.freenode.net/#golang">`</span>
--- /dev/null
- godocref: https://golang.org/src/html/template/content.go?s=2548:2557#L51
+---
+title: safeJS
+# linktitle:
+description: Declares the provided string as a known safe JavaScript string.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["safeJS INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+In this context, *safe* means the string encapsulates a known safe EcmaScript5 Expression (e.g., `(x + y * z())`).
+
+Template authors are responsible for ensuring that typed expressions do not break the intended precedence and that there is no statement/expression ambiguity as when passing an expression like `{ foo:bar() }\n['foo']()`, which is both a valid expression and a valid program with a very different meaning.
+
+Example: Given `hash = "619c16f"` defined in the front matter of your `.md` file:
+
+* <span class="good">`<script>var form_{{ .Params.hash | safeJS }};…</script>` → `<script>var form_619c16f;…</script>`</span>
+* <span class="bad">`<script>var form_{{ .Params.hash }};…</script>` → `<script>var form_"619c16f";…</script>`</span>
--- /dev/null
- godocref: https://golang.org/pkg/html/template/#HTMLEscape
+---
+title: safeURL
+description: Declares the provided string as a safe URL or URL substring.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: [strings,urls]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+signature: ["safeURL INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+`safeURL` declares the provided string as a "safe" URL or URL substring (see [RFC 3986][]). A URL like `javascript:checkThatFormNotEditedBeforeLeavingPage()` from a trusted source should go in the page, but by default dynamic `javascript:` URLs are filtered out since they are a frequently exploited injection vector.
+
+Without `safeURL`, only the URI schemes `http:`, `https:` and `mailto:` are considered safe by Go templates. If any other URI schemes (e.g., `irc:` and `javascript:`) are detected, the whole URL will be replaced with `#ZgotmplZ`. This is to "defang" any potential attack in the URL by rendering it useless.
+
+The following examples use a [site `config.toml`][configuration] with the following [menu entry][menus]:
+
+{{< code file="config.toml" copy="false" >}}
+[[menu.main]]
+ name = "IRC: #golang at freenode"
+ url = "irc://irc.freenode.net/#golang"
+{{< /code >}}
+
+The following is an example of a sidebar partial that may be used in conjunction with the preceding front matter example:
+
+{{< code file="layouts/partials/bad-url-sidebar-menu.html" copy="false" >}}
+<!-- This unordered list may be part of a sidebar menu -->
+<ul>
+ {{ range .Site.Menus.main }}
+ <li><a href="{{ .URL }}">{{ .Name }}</a></li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
+This partial would produce the following HTML output:
+
+{{< output file="bad-url-sidebar-menu-output.html" >}}
+<!-- This unordered list may be part of a sidebar menu -->
+<ul>
+ <li><a href="#ZgotmplZ">IRC: #golang at freenode</a></li>
+</ul>
+{{< /output >}}
+
+The odd output can be remedied by adding ` | safeURL` to our `.URL` page variable:
+
+{{< code file="layouts/partials/correct-url-sidebar-menu.html" copy="false" >}}
+<!-- This unordered list may be part of a sidebar menu -->
+<ul>
+ <li><a href="{{ .URL | safeURL }}">{{ .Name }}</a></li>
+</ul>
+{{< /code >}}
+
+With the `.URL` page variable piped through `safeURL`, we get the desired output:
+
+{{< output file="correct-url-sidebar-menu-output.html" >}}
+<ul class="sidebar-menu">
+ <li><a href="irc://irc.freenode.net/#golang">IRC: #golang at freenode</a></li>
+</ul>
+{{< /output >}}
+
+[configuration]: /getting-started/configuration/
+[menus]: /content-management/menus/
+[RFC 3986]: https://tools.ietf.org/html/rfc3986
--- /dev/null
- godocref:
+---
+title: .Scratch
+description: Acts as a "scratchpad" to store and manipulate data.
- {{< new-in "0.43.0" >}} A Scratch instance can also be assigned to any variable using the `newScratch` function. In this case, no Page or Shortcode context is required and the scope of the scratch is only local. The methods detailed below are available from the variable the Scratch instance was assigned to.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: [iteration]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: []
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: [/extras/scratch/,/doc/scratch/]
+---
+
+Scratch is a Hugo feature designed to conveniently manipulate data in a Go Template world. It is either a Page or Shortcode method for which the resulting data will be attached to the given context, or it can live as a unique instance stored in a variable.
+
+{{% note %}}
+Note that Scratch was initially created as a workaround for a [Go template scoping limitation](https://github.com/golang/go/issues/10608) that affected Hugo versions prior to 0.48. For a detailed analysis of `.Scratch` and contextual use cases, see [this blog post](https://regisphilibert.com/blog/2017/04/hugo-scratch-explained-variable/).
+{{% /note %}}
+
+### Contexted `.Scratch` vs. local `newScratch`
+
+Since Hugo 0.43, there are two different ways of using Scratch:
+
+#### The Page's `.Scratch`
+
+`.Scratch` is available as a Page method or a Shortcode method and attaches the "scratched" data to the given page. Either a Page or a Shortcode context is required to use `.Scratch`.
+
+```go-html-template
+{{ .Scratch.Set "greeting" "bonjour" }}
+{{ range .Pages }}
+ {{ .Scratch.Set "greeting" (print "bonjour" .Title) }}
+{{ end }}
+```
+
+#### The local `newScratch`
+
- {{< new-in "0.38.0" >}} Remove the given key.
++{{< new-in "0.43" >}} A Scratch instance can also be assigned to any variable using the `newScratch` function. In this case, no Page or Shortcode context is required and the scope of the scratch is only local. The methods detailed below are available from the variable the Scratch instance was assigned to.
+
+```go-html-template
+{{ $data := newScratch }}
+{{ $data.Set "greeting" "hola" }}
+```
+
+### Methods
+
+A Scratch has the following methods:
+
+{{% note %}}
+Note that the following examples assume a [local Scratch instance](#the-local-newscratch) has been stored in `$scratch`.
+{{% /note %}}
+
+#### .Set
+
+Set the value of a given key.
+
+```go-html-template
+{{ $scratch.Set "greeting" "Hello" }}
+```
+
+#### .Get
+
+Get the value of a given key.
+
+```go-html-template
+{{ $scratch.Set "greeting" "Hello" }}
+----
+{{ $scratch.Get "greeting" }} > Hello
+```
+
+#### .Add
+
+Add 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
+{{ $scratch.Add "greetings" "Hello" }}
+{{ $scratch.Add "greetings" "Welcome" }}
+----
+{{ $scratch.Get "greetings" }} > HelloWelcome
+```
+
+```go-html-template
+{{ $scratch.Add "total" 3 }}
+{{ $scratch.Add "total" 7 }}
+----
+{{ $scratch.Get "total" }} > 10
+```
+
+```go-html-template
+{{ $scratch.Add "greetings" (slice "Hello") }}
+{{ $scratch.Add "greetings" (slice "Welcome" "Cheers") }}
+----
+{{ $scratch.Get "greetings" }} > []interface {}{"Hello", "Welcome", "Cheers"}
+```
+
+#### .SetInMap
+
+Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`.
+
+```go-html-template
+{{ $scratch.SetInMap "greetings" "english" "Hello" }}
+{{ $scratch.SetInMap "greetings" "french" "Bonjour" }}
+----
+{{ $scratch.Get "greetings" }} > map[french:Bonjour english:Hello]
+```
+
+#### .DeleteInMap
+Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
+
+```go-html-template
+{{ .Scratch.SetInMap "greetings" "english" "Hello" }}
+{{ .Scratch.SetInMap "greetings" "french" "Bonjour" }}
+----
+{{ .Scratch.DeleteInMap "greetings" "english" }}
+----
+{{ .Scratch.Get "greetings" }} > map[french:Bonjour]
+```
+
+#### .GetSortedMapValues
+
+Return an array of values from `key` sorted by `mapKey`.
+
+```go-html-template
+{{ $scratch.SetInMap "greetings" "english" "Hello" }}
+{{ $scratch.SetInMap "greetings" "french" "Bonjour" }}
+----
+{{ $scratch.GetSortedMapValues "greetings" }} > [Hello Bonjour]
+```
+
+#### .Delete
+
++{{< new-in "0.38" >}} Remove the given key.
+
+```go-html-template
+{{ $scratch.Set "greeting" "Hello" }}
+----
+{{ $scratch.Delete "greeting" }}
+```
+
+#### .Values
+
+Return the raw backing map. Note that you should only use this method on the locally scoped Scratch instances you obtain via [`newScratch`](#the-local-newscratch), not `.Page.Scratch` etc., as that will lead to concurrency issues.
+
+
+[pagevars]: /variables/page/
--- /dev/null
- godocref:
+---
+title: seq
+# linktitle:
+description: Creates a sequence of integers.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: []
+signature: ["seq LAST", "seq FIRST LAST", "seq FIRST INCREMENT LAST"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+It's named and used in the model of [GNU's seq][].
+
+```
+3 → 1, 2, 3
+1 2 4 → 1, 3
+-3 → -1, -2, -3
+1 4 → 1, 2, 3, 4
+1 -2 → 1, 0, -1, -2
+```
+
+## Example: `seq` with `range` and `after`
+
+You can use `seq` in combination with `range` and `after`. The following will return 19 elements:
+
+```
+{{ range after 1 (seq 20)}}
+{{ end }}
+```
+
+However, when ranging with an index, the following may be less confusing in that `$indexStartingAt1` and `$num` will return `1,2,3 ... 20`:
+
+```
+{{ range $index, $num := (seq 20) }}
+$indexStartingAt1 := (add $index 1)
+{{ end }}
+```
+
+
+[GNU's seq]: https://www.gnu.org/software/coreutils/manual/html_node/seq-invocation.html#seq-invocation
--- /dev/null
- godocref:
+---
+title: sha
+# linktitle: sha
+description: Hashes the given input and returns either an SHA1 or SHA256 checksum.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [sha,checksum]
+signature: ["sha1 INPUT", "sha256 INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: [md5]
+deprecated: false
+aliases: [sha1, sha256]
+---
+
+`sha1` hashes the given input and returns its SHA1 checksum.
+
+```
+{{ sha1 "Hello world, gophers!" }}
+<!-- returns the string "c8b5b0e33d408246e30f53e32b8f7627a7a649d4" -->
+```
+
+`sha256` hashes the given input and returns its SHA256 checksum.
+
+```
+{{ sha256 "Hello world, gophers!" }}
+<!-- returns the string "6ec43b78da9669f50e4e422575c54bf87536954ccd58280219c393f2ce352b46" -->
+```
--- /dev/null
- godocref:
+---
+title: shuffle
+# linktitle:
+description: Returns a random permutation of a given array or slice.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-04-30
+keywords: [ordering]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+signature: ["shuffle COLLECTION"]
+workson: []
+hugoversion:
+relatedfuncs: [seq]
+deprecated: false
+draft: false
+aliases: []
+---
+
+{{< code file="shuffle-input.html" >}}
+<!-- Shuffled sequence = -->
+<div>{{ shuffle (seq 1 5) }}</div>
+<!-- Shuffled slice = -->
+<div>{{ shuffle (slice "foo" "bar" "buzz") }}</div>
+{{< /code >}}
+
+This example would return the following:
+
+{{< output file="shuffle-output.html" >}}
+<!-- Shuffled sequence = -->
+<div>2 5 3 1 4</div>
+<!-- Shuffled slice = -->
+<div>buzz foo bar</div>
+{{< /output >}}
+
+This example also makes use of the [slice](/functions/slice/) and [seq](/functions/seq/) functions.
--- /dev/null
- godocref:
+---
+title: singularize
+# linktitle: singularize
+description: Converts a word according to a set of common English singularization rules.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,singular]
+signature: ["singularize INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+`{{ "cats" | singularize }}` → "cat"
+
+See also the `.Data.Singular` [taxonomy variable](/variables/taxonomy/) for singularizing taxonomy names.
--- /dev/null
- godocref:
+---
+title: site
+linktitle: site
+description: The `site` function provides global access to the same data as the `.Site` page method.
-
-
+date: 2021-02-11
+publishdate: 2021-02-11
+lastmod: 2021-02-11
+keywords: []
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: ["site"]
+workson: []
+hugoversion:
+relatedfuncs: ["hugo"]
+deprecated: false
+draft: false
+aliases: []
+---
+
+`site` is a global function which returns the same data as the `.Site` page method. See: [Site Variables]({{< relref "/variables/site" >}}).
--- /dev/null
- godocref:
+---
+title: slice
+# linktitle: slice
+description: Creates a slice (array) of all passed arguments.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [slice, array, interface]
+signature: ["slice ITEM..."]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+toc: false
+---
+
+One use case is the concatenation of elements in combination with the [`delimit` function][]:
+
+{{< code file="slice.html" >}}
+{{ delimit (slice "foo" "bar" "buzz") ", " }}
+<!-- returns the string "foo, bar, buzz" -->
+{{< /code >}}
+
+
+[`delimit` function]: /functions/delimit/
--- /dev/null
- godocref:
+---
+title: slicestr
+# linktitle:
+description: Creates a slice of a half-open range, including start and end indices.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["slicestr STRING START [END]"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+For example, 1 and 4 creates a slice including elements 1 through 3.
+The `end` index can be omitted; it defaults to the string's length.
+
+* `{{slicestr "BatMan" 3}}` → "Man"
+* `{{slicestr "BatMan" 0 3}}` → "Bat"
--- /dev/null
- godocref:
+---
+title: sort
+# linktitle: sort
+description: Sorts maps, arrays, and slices and returns a sorted slice.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [ordering,sorting,lists]
+signature: []
+workson: [lists,taxonomies,terms,groups]
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+A sorted array of map values will be returned with the keys eliminated. There are two optional arguments: `sortByField` and `sortAsc`. If left blank, sort will sort by keys (for maps) in ascending order as its default behavior.
+
+```
+---
+tags: ["tag3", "tag1", "tag2"]
+---
+
+// Site config
++++
+[params.authors]
+ [params.authors.Joe]
+ firstName = "Joe"
+ lastName = "Bergevin"
+ [params.authors.Derek]
+ firstName = "Derek"
+ lastName = "Perkins"
+ [params.authors.Tanner]
+ firstName = "Tanner"
+ lastName = "Linsley"
++++
+```
+
+```
+// Sort by value, ascending (default for lists)
+Tags: {{ range sort .Params.tags }}{{ . }} {{ end }}
+
+→ Outputs Tags: tag1 tag2 tag3
+
+// Sort by value, descending
+Tags: {{ range sort .Params.tags "value" "desc" }}{{ . }} {{ end }}
+
+→ Outputs Tags: tag3 tag2 tag1
+
+// Sort by key, ascending (default for maps)
+Authors: {{ range sort .Site.Params.authors }}{{ .firstName }} {{ end }}
+
+→ Outputs Authors: Derek Joe Tanner
+
+// Sort by field, descending
+Authors: {{ range sort .Site.Params.authors "lastName" "desc" }}{{ .lastName }} {{ end }}
+
+→ Outputs Authors: Perkins Linsley Bergevin
+```
--- /dev/null
- godocref:
+---
+title: split
+# linktitle: split
+description: splits a string into substrings separated by a delimiter
-
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["split STRING DELIM"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+* `{{split "tag1,tag2,tag3" "," }}` → ["tag1" "tag2" "tag3"]
--- /dev/null
- godocref:
+---
+title: string
+# linktitle: string
+description: Creates a string from the argument passed to the function
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["string INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+* `{{string "BatMan"}}` → "BatMan"
--- /dev/null
- godocref:
+---
+title: strings.Count
+description: Returns the number of non-overlapping instances of a substring within a string.
+date: 2020-09-07
+publishdate: 2020-09-07
+lastmod: 2020-09-07
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [count, counting, character count]
+signature: ["strings.Count SUBSTR STRING"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+{{< new-in "0.74.0" >}}
+
+If `SUBSTR` is an empty string, this function returns 1 plus the number of Unicode code points in `STRING`.
+
+Example|Result
+:--|:--
+`{{ "aaabaab" | strings.Count "a" }}`|5
+`{{ "aaabaab" | strings.Count "aa" }}`|2
+`{{ "aaabaab" | strings.Count "aaa" }}`|1
+`{{ "aaabaab" | strings.Count "" }}`|8
--- /dev/null
- godocref:
+---
+title: strings.HasSuffix
+description: Determine whether or not a given string ends with the provided trailing suffix string.
+date: 2019-08-13
+publishdate: 2019-08-13
+lastmod: 2019-08-13
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["strings.HasSuffix STRING SUFFIX"]
+workson: []
+hugoversion:
+relatedfuncs: [hasPrefix]
+deprecated: false
+aliases: []
+---
+
+ {{ $pdfPath := "/path/to/some.pdf" }}
+ {{ strings.HasSuffix $pdfPath "pdf" }} → true
+ {{ strings.HasSuffix $pdfPath "txt" }} → false
--- /dev/null
- godocref:
+---
+title: strings.Repeat
+# linktitle:
+description: Returns INPUT repeated COUNT times.
+date: 2018-05-31
+publishdate: 2018-05-31
+lastmod: 2018-05-31
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["strings.Repeat COUNT INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+```
+{{ strings.Repeat 3 "yo" }} → "yoyoyo"
+{{ "yo" | strings.Repeat 3 }} → "yoyoyo"
+```
--- /dev/null
- godocref:
+---
+title: strings.RuneCount
+description: Determines the number of runes in a string.
- [`utf8.RuneCount`]: https://golang.org/pkg/unicode/utf8/#RuneCount
+date: 2018-06-01
+publishdate: 2018-06-01
+lastmod: 2018-06-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [counting, character count, length, rune length, rune count]
+signature: ["strings.RuneCount INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: ["len", "countrunes"]
+deprecated: false
+aliases: []
+---
+
+In contrast with `strings.CountRunes` function, which strips HTML and whitespace before counting runes, `strings.RuneCount` simply counts all the runes in a string. It relies on the Go [`utf8.RuneCountInString`] function.
+
+```
+{{ "Hello, 世界" | strings.RuneCount }}
+<!-- outputs a content length of 9 runes. -->
+```
+
++[`utf8.RuneCount`]: https://golang.org/pkg/unicode/utf8/#RuneCount
--- /dev/null
- godocref:
+---
+title: strings.TrimLeft
+description: Returns a slice of a given string with all leading characters contained in the cutset removed.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["strings.TrimLeft CUTSET STRING"]
+workson: []
+hugoversion:
+relatedfuncs: [strings.TrimRight]
+deprecated: false
+aliases: []
+---
+
+Given the string `"abba"`, leading `"a"`'s can be removed a follows:
+
+ {{ strings.TrimLeft "a" "abba" }} → "bba"
+
+Numbers can be handled as well:
+
+ {{ strings.TrimLeft 12 1221341221 }} → "341221"
--- /dev/null
- godocref:
+---
+title: strings.TrimPrefix
+description: Returns a given string s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged.
- {{ strings.TrimPrefix "aaa" "aabbaa" }} → "aabbaa"
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["strings.TrimPrefix PREFIX STRING"]
+workson: []
+hugoversion:
+relatedfuncs: [strings.TrimSuffix]
+deprecated: false
+aliases: []
+---
+
+Given the string `"aabbaa"`, the specified prefix is only removed if `"aabbaa"` starts with it:
+
+ {{ strings.TrimPrefix "a" "aabbaa" }} → "abbaa"
+ {{ strings.TrimPrefix "aa" "aabbaa" }} → "bbaa"
++ {{ strings.TrimPrefix "aaa" "aabbaa" }} → "aabbaa"
--- /dev/null
- godocref:
+---
+title: strings.TrimRight
+description: Returns a slice of a given string with all trailing characters contained in the cutset removed.
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["strings.TrimRight CUTSET STRING"]
+workson: []
+hugoversion:
+relatedfuncs: [strings.TrimRight]
+deprecated: false
+aliases: []
+---
+
+Given the string `"abba"`, trailing `"a"`'s can be removed a follows:
+
+ {{ strings.TrimRight "a" "abba" }} → "abb"
+
+Numbers can be handled as well:
+
+ {{ strings.TrimRight 12 1221341221 }} → "122134"
--- /dev/null
- godocref:
+---
+title: strings.TrimSuffix
+description: Returns a given string s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged.
- {{ strings.TrimSuffix "aaa" "aabbaa" }} → "aabbaa"
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["strings.TrimSuffix SUFFIX STRING"]
+workson: []
+hugoversion:
+relatedfuncs: [strings.TrimPrefix]
+deprecated: false
+aliases: []
+---
+
+Given the string `"aabbaa"`, the specified suffix is only removed if `"aabbaa"` ends with it:
+
+ {{ strings.TrimSuffix "a" "aabbaa" }} → "aabba"
+ {{ strings.TrimSuffix "aa" "aabbaa" }} → "aabb"
++ {{ strings.TrimSuffix "aaa" "aabbaa" }} → "aabbaa"
--- /dev/null
- godocref:
+---
+title: substr
+# linktitle:
+description: Extracts parts of a string from a specified character's position and returns the specified number of characters.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+aliases: []
+signature: ["substr STRING START [LENGTH]"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+It normally takes two parameters: `start` and `length`. It can also take one parameter: `start`, i.e. `length` is omitted, in which case the substring starting from start until the end of the string will be returned.
+
+To extract characters from the end of the string, use a negative start number.
+
+In addition, borrowing from the extended behavior described at https://php.net substr, if `length` is given and is negative, that number of characters will be omitted from the end of string.
+
+```
+{{ substr "abcdef" 0 }} → "abcdef"
+{{ substr "abcdef" 1 }} → "bcdef"
+
+{{ substr "abcdef" 0 1 }} → "a"
+{{ substr "abcdef" 1 1 }} → "b"
+
+{{ substr "abcdef" 0 -1 }} → "abcde"
+{{ substr "abcdef" 1 -1 }} → "bcde"
+
+{{ substr "abcdef" -1 }} → "f"
+{{ substr "abcdef" -2 }} → "ef"
+
+{{ substr "abcdef" -1 1 }} → "f"
+{{ substr "abcdef" -2 1 }} → "e"
+
+{{ substr "abcdef" -3 -1 }} → "de"
+{{ substr "abcdef" -3 -2 }} → "d"
+```
--- /dev/null
- godocref: ""
+---
+title: templates.Exists
+linktitle: ""
+description: "Checks whether a template file exists under the given path relative to the `layouts` directory."
+date: 2018-11-01
+publishdate: 2018-11-01
+lastmod: 2018-11-01
+categories: [functions]
+tags: []
+menu:
+ docs:
+ parent: "functions"
+ns: ""
+keywords: ["templates", "template", "layouts"]
+signature: ["templates.Exists PATH"]
+workson: []
+hugoversion: "0.46"
+aliases: []
+relatedfuncs: []
+toc: false
+deprecated: false
+---
+
+A template file is any file living below the `layouts` directories of either the project or any of its theme components including partials and shortcodes.
+
+The function is particularly handy with dynamic path. The following example ensures the build will not break on a `.Type` missing its dedicated `header` partial.
+
+```go-html-template
+{{ $partialPath := printf "headers/%s.html" .Type }}
+{{ if templates.Exists ( printf "partials/%s" $partialPath ) }}
+ {{ partial $partialPath . }}
+{{ else }}
+ {{ partial "headers/default.html" . }}
+{{ end }}
+
+```
--- /dev/null
- godocref:
+---
+title: time
+linktitle:
+description: Converts a timestamp string into a `time.Time` structure.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [dates,time,location]
+signature: ["time INPUT [TIMEZONE]"]
+workson: []
+hugoversion: "v0.77.0"
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+`time` converts a timestamp string with an optional default location into a [`time.Time`](https://godoc.org/time#Time) structure so you can access its fields:
+
+```
+{{ time "2016-05-28" }} → "2016-05-28T00:00:00Z"
+{{ (time "2016-05-28").YearDay }} → 149
+{{ mul 1000 (time "2016-05-28T10:30:00.00+10:00").Unix }} → 1464395400000, or Unix time in milliseconds
+```
+
+## Using Locations
+
+The optional `TIMEZONE` parameter is a string that sets a default time zone (or more specific, the location, which represents the collection of time offsets in a geographical area) that is associated with the specified time value. If the time value has an explicit timezone or offset specified, it will take precedence over the `TIMEZONE` parameter.
+
+The list of valid locations may be system dependent, but should include `UTC`, `Local`, or any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
+
+If no `TIMEZONE` is set, the `timeZone` from site configuration will be used.
+
+```
+{{ time "2020-10-20" }} → 2020-10-20 00:00:00 +0000 UTC
+{{ time "2020-10-20" "America/Los_Angeles" }} → 2020-10-20 00:00:00 -0700 PDT
+{{ time "2020-01-20" "America/Los_Angeles" }} → 2020-01-20 00:00:00 -0800 PST
+```
+
+## Example: Using `time` to get Month Index
+
+The following example takes a UNIX timestamp---set as `utimestamp: "1489276800"` in a content's front matter---converts the timestamp (string) to an integer using the [`int` function][int], and then uses [`printf`][] to convert the `Month` property of `time` into an index.
+
+The following example may be useful when setting up [multilingual sites][multilingual]:
+
+{{< code file="unix-to-month-integer.html" >}}
+{{$time := time (int .Params.addDate)}}
+=> $time = 1489276800
+{{$time.Month}}
+=> "March"
+{{$monthindex := printf "%d" $time.Month }}
+=> $monthindex = 3
+{{< /code >}}
+
+
+[int]: /functions/int/
+[multilingual]: /content-management/multilingual/
+[`printf`]: /functions/printf/
--- /dev/null
- godocref:
+---
+title: title
+# linktitle:
+description: Converts all characters in the provided string to title case.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["title INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+
+```
+{{title "BatMan"}}` → "Batman"
+```
+
+Can be combined in pipes. In the following snippet, the link text is cleaned up using `humanize` to remove dashes and `title` to convert the value of `$name` to Initial Caps.
+
+```
+{{ range $name, $items := .Site.Taxonomies.categories }}
+ <li><a href="{{ printf "%s/%s" "categories" ($name | urlize | lower) | absURL }}">{{ $name | humanize | title }} ({{ len $items }})</a></li>
+{{ end }}
+```
+
+## Configure Title Case
+
+The default is AP Stylebook, but you can [configure it](/getting-started/configuration/#configure-title-case).
--- /dev/null
- godocref:
+---
+title: trim
+# linktitle:
+description: Returns a slice of a passed string with all leading and trailing characters from cutset removed.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["trim INPUT CUTSET"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+```
+{{ trim "++Batman--" "+-" }} → "Batman"
+```
+
+`trim` *requires* the second argument, which tells the function specifically what to remove from the first argument. There is no default value for the second argument, so **the following usage will not work**:
+
+```
+{{ trim .Inner}}
+```
+
+Instead, the following example tells `trim` to remove extra new lines from the content contained in the [shortcode `.Inner` variable][shortcodevars]:
+
+```
+{{ trim .Inner "\n" }}
+```
+
+{{% note %}}
+Go templates also provide a simple [method for trimming whitespace](/templates/introduction/#whitespace) from either side of a Go tag by including a hyphen (`-`).
+{{% /note %}}
+
+
+[shortcodevars]: /variables/shortcodes/
--- /dev/null
- godocref:
+---
+title: truncate
+# linktitle: truncate
+description: Truncates a text to a max length without cutting words or leaving unclosed HTML tags.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["truncate SIZE INPUT", "truncate SIZE ELLIPSIS INPUT"]
+workson: []
+hugoversion: 19
+relatedfuncs: []
+deprecated: false
+---
+
+Since Go templates are HTML-aware, `truncate` will intelligently handle normal strings vs HTML strings:
+
+```
+{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → <em>Keep my …</em>`
+```
+
+{{% note %}}
+If you have a raw string that contains HTML tags you want to remain treated as HTML, you will need to convert the string to HTML using the [`safeHTML` template function](/functions/safehtml) before sending the value to truncate. Otherwise, the HTML tags will be escaped when passed through the `truncate` function.
+{{% /note %}}
--- /dev/null
- godocref:
+---
+title: union
+# linktitle: union
+description: Given two arrays or slices, returns a new array that contains the elements or objects that belong to either or both arrays/slices.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-03-12
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [filtering,lists]
+signature: ["union SET1 SET2"]
+workson: []
+hugoversion: 0.20
+relatedfuncs: [intersect,where]
+deprecated: false
+aliases: []
+---
+
+Given two arrays (or slices) A and B, this function will return a new array that contains the elements or objects that belong to either A or to B or to both. The elements supported are strings, integers, and floats (only float64).
+
+```
+{{ union (slice 1 2 3) (slice 3 4 5) }}
+<!-- returns [1 2 3 4 5] -->
+
+{{ union (slice 1 2 3) nil }}
+<!-- returns [1 2 3] -->
+
+{{ union nil (slice 1 2 3) }}
+<!-- returns [1 2 3] -->
+
+{{ union nil nil }}
+<!-- returns an error because both arrays/slices have to be of the same type -->
+```
+
+## OR filter in where query
+
+This is also very useful to use as `OR` filters when combined with where:
+
+```
+{{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }}
+{{ $pages := $pages | union (where .Site.RegularPages "Params.pinned" true) }}
+{{ $pages := $pages | intersect (where .Site.RegularPages "Params.images" "!=" nil) }}
+```
+
+The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page params.
+
+See [intersect](/functions/intersect) for `AND`.
--- /dev/null
- godocref:
+---
+title: uniq
+linktitle: uniq
+description: Takes in a slice or array and returns a slice with subsequent duplicate elements removed.
-
-
-
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [multilingual,i18n,urls]
+signature: ["uniq SET"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+needsexamples: false
+---
+
+```
+{{ uniq (slice 1 2 3 2) }}
+{{ slice 1 2 3 2 | uniq }}
+<!-- both return [1 2 3] -->
+```
--- /dev/null
- godocref: https://golang.org/search?q=Unix#Functions
+---
+title: .Unix
+draft: false
+description: .Unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: [dates,time]
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+signature: [".Unix"]
+workson: [times]
+hugoversion:
+relatedfuncs: [Format,dateFormat,now,time]
+deprecated: false
+aliases: []
+---
+
+## Example: Time Passed Since Last Modification
+
+This very simple one-liner uses `now.Unix` to calculate the amount of time that has passed between the `.LastMod` for the current page and the last build of the current page.
+
+{{< code file="time-passed.html" >}}
+{{ div (sub now.Unix .Lastmod.Unix) 86400 }}
+{{< /code >}}
+
+Since both values are integers, they can be subtracted and then divided by the number of seconds in a day (i.e., `60 * 60 * 24 == 86400`).
+
+{{% note %}}
+Hugo's output is *static*. For the example above to be realistic, the site needs to be built every day.
+ {{% /note %}}
+
+[partial template]: /templates/partials/
--- /dev/null
- godocref:
+---
+title: upper
+# linktitle: upper
+description: Converts all characters in a string to uppercase
-
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+keywords: []
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+toc:
+signature: ["upper INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+draft: false
+aliases: []
+---
+
+Note that `upper` can be applied in your templates in more than one way:
+
+```
+{{ upper "BatMan" }} → "BATMAN"
+{{ "BatMan" | upper }} → "BATMAN"
+```
--- /dev/null
- godocref:
+---
+title: urlize
+# linktitle: urlize
+description: Takes a string, sanitizes it for usage in URLs, and converts spaces to hyphens.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [urls,strings]
+signature: ["urlize INPUT"]
+hugoversion:
+deprecated: false
+workson: []
+relatedfuncs: []
+---
+
+The following examples pull from a content file with the following front matter:
+
+{{< code file="content/blog/greatest-city.md" copy="false">}}
++++
+title = "The World's Greatest City"
+location = "Chicago IL"
+tags = ["pizza","beer","hot dogs"]
++++
+{{< /code >}}
+
+The following might be used as a partial within a [single page template][singletemplate]:
+
+{{< code file="layouts/partials/content-header.html" download="content-header.html" >}}
+<header>
+ <h1>{{.Title}}</h1>
+ {{ with .Params.location }}
+ <div><a href="/locations/{{ . | urlize}}">{{.}}</a></div>
+ {{ end }}
+ <!-- Creates a list of tags for the content and links to each of their pages -->
+ {{ with .Params.tags }}
+ <ul>
+ {{range .}}
+ <li>
+ <a href="/tags/{{ . | urlize }}">{{ . }}</a>
+ </li>
+ {{end}}
+ </ul>
+ {{ end }}
+</header>
+{{< /code >}}
+
+The preceding partial would then output to the rendered page as follows, assuming the page is being built with Hugo's default pretty URLs.
+
+{{< output file="/blog/greatest-city/index.html" >}}
+<header>
+ <h1>The World's Greatest City</h1>
+ <div><a href="/locations/chicago-il">Chicago IL</a></div>
+ <ul>
+ <li>
+ <a href="/tags/pizza">pizza</a>
+ </li>
+ <li>
+ <a href="/tags/beer">beer</a>
+ </li>
+ <li>
+ <a href="/tags/hot-dogs">hot dogs</a>
+ </li>
+ </ul>
+</header>
+{{< /output >}}
+
+
+
+[singletemplate]: /templates/single-page-templates/
--- /dev/null
- godocref: https://godoc.org/net/url#URL
+---
+title: urls.Parse
+description: Parse parses a given url, which may be relative or absolute, into a URL structure.
- ```
+date: 2017-09-25
+publishdate: 2017-09-25
+lastmod: 2017-09-25
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [urls]
+signature: ["urls.Parse URL"]
+workson: []
+hugoversion:
+deprecated: false
+aliases: []
+---
+
+`urls.Parse` takes a url as input
+
+
+```
+{{ $url := urls.Parse "http://www.gohugo.io" }}
+```
+
+and returns a [URL](https://godoc.org/net/url#URL) structure. The struct fields are accessed via the `.` notation:
+
+```
+{{ $url.Scheme }} → "http"
+{{ $url.Host }} → "www.gohugo.io"
++```
--- /dev/null
- godocref:
+---
+title: where
+# linktitle: where
+description: Filters an array to only the elements containing a matching value for a given field.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [filtering]
+signature: ["where COLLECTION KEY [OPERATOR] MATCH"]
+workson: [lists,taxonomies,terms,groups]
+hugoversion:
+relatedfuncs: [intersect,first,after,last]
+deprecated: false
+toc: true
+needsexample: true
+---
+
+`where` filters an array to only the elements containing a matching
+value for a given field.
+
+It works in a similar manner to the [`where` keyword in
+SQL][wherekeyword].
+
+```go-html-template
+{{ range where .Pages "Section" "foo" }}
+ {{ .Content }}
+{{ end }}
+```
+
+It can be used by dot-chaining the second argument to refer to a nested element of a value.
+
+```
++++
+series: golang
++++
+```
+
+```go-html-template
+{{ range where .Site.Pages "Params.series" "golang" }}
+ {{ .Content }}
+{{ end }}
+```
+
+It can also be used with the logical operators `!=`, `>=`, `in`, etc. Without an operator, `where` compares a given field with a matching value equivalent to `=`.
+
+```go-html-template
+{{ range where .Pages "Section" "!=" "foo" }}
+ {{ .Content }}
+{{ end }}
+```
+
+The following logical operators are available with `where`:
+
+`=`, `==`, `eq`
+: `true` if a given field value equals a matching value
+
+`!=`, `<>`, `ne`
+: `true` if a given field value doesn't equal a matching value
+
+`>=`, `ge`
+: `true` if a given field value is greater than or equal to a matching value
+
+`>`, `gt`
+: `true` if a given field value is greater than a matching value
+
+`<=`, `le`
+: `true` if a given field value is lesser than or equal to a matching value
+
+`<`, `lt`
+: `true` if a given field value is lesser than a matching value
+
+`in`
+: `true` if a given field value is included in a matching value; a matching value must be an array or a slice
+
+`not in`
+: `true` if a given field value isn't included in a matching value; a matching value must be an array or a slice
+
+`intersect`
+: `true` if a given field value that is a slice/array of strings or integers contains elements in common with the matching value; it follows the same rules as the [`intersect` function][intersect].
+
+## Use `where` with `Booleans`
+When using booleans you should not put quotation marks.
+```go-html-template
+{{range where .Pages "Draft" true}}
+ <p>{{.Title}}</p>
+{{end}}
+```
+
+
+## Use `where` with `intersect`
+
+```go-html-template
+{{ range where .Site.Pages "Params.tags" "intersect" .Params.tags }}
+ {{ if ne .Permalink $.Permalink }}
+ {{ .Render "summary" }}
+ {{ end }}
+{{ end }}
+```
+
+You can also put the returned value of the `where` clauses into a variable:
+
+{{< code file="where-intersect-variables.html" >}}
+{{ $v1 := where .Site.Pages "Params.a" "v1" }}
+{{ $v2 := where .Site.Pages "Params.b" "v2" }}
+{{ $filtered := $v1 | intersect $v2 }}
+{{ range $filtered }}
+{{ end }}
+{{< /code >}}
+
+## Use `where` with `first`
+
+Using `first` and `where` together can be very
+powerful. Below snippet gets a list of posts only from [**main
+sections**](#mainsections), sorts it using the [default
+ordering](/templates/lists/) for lists (i.e., `weight => date`), and
+then ranges through only the first 5 posts in that list:
+
+{{< code file="first-and-where-together.html" >}}
+{{ range first 5 (where site.RegularPages "Type" "in" site.Params.mainSections) }}
+ {{ .Content }}
+{{ end }}
+{{< /code >}}
+
+## Nest `where` Clauses
+
+You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured:
+
+```go-html-template
+{{ range where (where .Pages "Section" "blog" ) "Params.featured" "!=" true }}
+```
+
+## Unset Fields
+
+Filtering only works for set fields. To check whether a field is set or exists, you can use the operand `nil`.
+
+This can be useful to filter a small amount of pages from a large pool. Instead of setting a field on all pages, you can set that field on required pages only.
+
+Only the following operators are available for `nil`
+
+* `=`, `==`, `eq`: True if the given field is not set.
+* `!=`, `<>`, `ne`: True if the given field is set.
+
+```go-html-template
+{{ range where .Pages "Params.specialpost" "!=" nil }}
+ {{ .Content }}
+{{ end }}
+```
+
+## Portable `where` filters -- `site.Params.mainSections` {#mainsections}
+
+**This is especially important for themes.**
+
+To list the most relevant pages on the front page or similar, you
+should use the `site.Params.mainSections` list instead of comparing
+section names to hard-coded values like `"posts"` or `"post"`.
+
+```go-html-template
+{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+```
+
+If the user has not set this config parameter in their site config, it
+will default to the _section with the most pages_.
+
+The user can override the default:
+
+{{< code-toggle file="config" >}}
+[params]
+ mainSections = ["blog", "docs"]
+{{< /code-toggle >}}
+
+[intersect]: /functions/intersect/
+[wherekeyword]: https://www.techonthenet.com/sql/where.php
--- /dev/null
- godocref:
+---
+title: with
+# linktitle: with
+description: Rebinds the context (`.`) within its scope and skips the block if the variable is absent or empty.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-03-12
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [conditionals]
+signature: ["with INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+---
+
+An alternative way of writing an `if` statement and then referencing the same value is to use `with` instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent, unset or empty.
+
+The set of *empty* values is defined by [the Go templates package](https://golang.org/pkg/text/template/). Empty values include `false`, the number zero, and the empty string.
+
+If you want to render a block if an index or key is present in a slice, array, channel or map, regardless of whether the value is empty, you should use [`isset`](/functions/isset) instead.
+
+The following example checks for a [user-defined site variable](/variables/site/) called `twitteruser`. If the key-value is not set, the following will render nothing:
+
+{{< code file="layouts/partials/twitter.html" >}}
+{{with .Site.Params.twitteruser}}<span class="twitter">
+<a href="https://twitter.com/{{.}}" rel="author">
+<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
+ alt="Twitter"></a>
+</span>{{end}}
+{{< /code >}}
--- /dev/null
- The path element used during pagination (https://example.com/page/2).
+---
+title: Configure Hugo
+linktitle: Configuration
+description: How to configure your Hugo site.
+date: 2013-07-01
+publishdate: 2017-01-02
+lastmod: 2017-03-05
+categories: [getting started,fundamentals]
+keywords: [configuration,toml,yaml,json]
+menu:
+ docs:
+ parent: "getting-started"
+ weight: 60
+weight: 60
+sections_weight: 60
+draft: false
+aliases: [/overview/source-directory/,/overview/configuration/]
+toc: true
+---
+
+
+## Configuration File
+
+Hugo uses the `config.toml`, `config.yaml`, or `config.json` (if found in the
+site root) as the default site config file.
+
+The user can choose to override that default with one or more site config files
+using the command line `--config` switch.
+
+Examples:
+
+```
+hugo --config debugconfig.toml
+hugo --config a.toml,b.toml,c.toml
+```
+
+{{% note %}}
+Multiple site config files can be specified as a comma-separated string to the `--config` switch.
+{{% /note %}}
+
+{{< todo >}}TODO: distinct config.toml and others (the root object files){{< /todo >}}
+
+## Configuration Directory
+
+In addition to using a single site config file, one can use the `configDir` directory (default to `config/`) to maintain easier organization and environment specific settings.
+
+- 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:
+
+{{< code-toggle file="config" >}}
+[Params]
+ foo = "bar"
+{{< /code-toggle >}}
+
+{{< 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.
+
+
+```
+├── config
+│ ├── _default
+│ │ ├── config.toml
+│ │ ├── languages.toml
+│ │ ├── menus.en.toml
+│ │ ├── menus.zh.toml
+│ │ └── params.toml
+│ ├── production
+│ │ ├── config.toml
+│ │ └── params.toml
+│ └── staging
+│ ├── config.toml
+│ └── params.toml
+```
+
+Considering the structure above, when running `hugo --environment staging`, Hugo will use every settings from `config/_default` and merge `staging`'s on top of those.
+{{% 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.
+
+deep
+: 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
+value in parentheses. Users may choose to override those values in their site
+config file(s).
+
+### archetypeDir
+
+**Default value:** "archetypes"
+
+The directory where Hugo finds archetype files (content templates). {{% module-mounts-note %}}
+
+### assetDir
+
+**Default value:** "assets"
+
+The directory where Hugo finds asset files used in [Hugo Pipes](/hugo-pipes/). {{% module-mounts-note %}}
+
+### baseURL
+Hostname (and path) to the root, e.g. https://bep.is/
+
+### blackfriday
+See [Configure Blackfriday](/getting-started/configuration-markup#blackfriday)
+
+### build
+See [Configure Build](#configure-build)
+
+### buildDrafts (false)
+
+**Default value:** false
+
+Include drafts when building.
+
+### buildExpired
+
+**Default value:** false
+
+Include content already expired.
+
+### buildFuture
+
+**Default value:** false
+
+Include content with publishdate in the future.
+
+### caches
+See [Configure File Caches](#configure-file-caches)
+
+### cascade
+
+{{< new-in "0.86.0" >}}
+
+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).
+
+### canonifyURLs
+
+**Default value:** false
+
+Enable to turn relative URLs into absolute.
+
+### contentDir
+
+**Default value:** "content"
+
+The directory from where Hugo reads content files. {{% module-mounts-note %}}
+
+### dataDir
+
+**Default value:** "data"
+
+The directory from where Hugo reads data files. {{% module-mounts-note %}}
+
+### defaultContentLanguage
+
+**Default value:** "en"
+
+Content without language indicator will default to this language.
+
+### defaultContentLanguageInSubdir
+
+**Default value:** false
+
+Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`.
+
+### disableAliases
+
+**Default value:** 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.
+
+### disableHugoGeneratorInject
+
+**Default value:** false
+
+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.
+
+### disableKinds
+
+**Default value:** []
+
+Enable disabling of all pages of the specified *Kinds*. Allowed values in this list: `"page"`, `"home"`, `"section"`, `"taxonomy"`, `"term"`, `"RSS"`, `"sitemap"`, `"robotsTXT"`, `"404"`.
+
+### disableLiveReload
+
+**Default value:** false
+
+Disable automatic live reloading of browser window.
+
+### 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 Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet/).
+
+### 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
+
+See [Front matter Configuration](#configure-front-matter).
+
+### footnoteAnchorPrefix
+
+**Default value:** ""
+
+Prefix for footnote anchors.
+
+### footnoteReturnLinkContents
+
+**Default value:** ""
+
+Text to display for footnote return links.
+
+### googleAnalytics
+
+**Default value:** ""
+
+Google Analytics tracking ID.
+
+### hasCJKLanguage
+
+**Default value:** false
+
+If true, auto-detect Chinese/Japanese/Korean Languages in the content. This will make `.Summary` and `.WordCount` behave correctly for CJK languages.
+
+### imaging
+See [Image Processing Config](/content-management/image-processing/#image-processing-config).
+
+### languages
+See [Configure Languages](/content-management/multilingual/#configure-languages).
+
+### disableLanguages
+
+See [Disable a Language](/content-management/multilingual/#disable-a-language)
+
+### markup
+See [Configure Markup](/getting-started/configuration-markup).{{< new-in "0.60.0" >}}
+
+### mediaTypes
+See [Configure Media Types](/templates/output-formats/#media-types).
+
+### menus
+See [Add Non-content Entries to a Menu](/content-management/menus/#add-non-content-entries-to-a-menu).
+
+### minify
+See [Configure Minify](#configure-minify)
+
+### module
+Module config see [Module Config](/hugo-modules/configuration/).{{< new-in "0.56.0" >}}
+
+### newContentEditor
+The editor to use when creating new content.
+
+### noChmod
+Don't sync permission mode of files.
+
+### noTimes
+Don't sync modification time of files.
+
+### outputFormats
+See [Configure Output Formats](#configure-additional-output-formats).
+
+### paginate
+
+**Default value:** 10
+
+Default number of elements per page in [pagination](/templates/pagination/).
+
+### paginatePath
+
+**Default value:** "page"
+
- When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this logg level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
++The path element used during pagination (`https://example.com/page/2`).
+
+### permalinks
+See [Content Management](/content-management/urls/#permalinks).
+
+### pluralizeListTitles
+
+**Default value:** true
+
+Pluralize titles in lists.
+
+### publishDir
+
+**Default value:** "public"
+
+The directory to where Hugo will write the final static site (the HTML files etc.).
+
+### related
+: See [Related Content](/content-management/related/#configure-related-content).{{< new-in "0.27" >}}
+
+### relativeURLs
+Enable this to make all relative URLs relative to content root. Note that this does not affect absolute URLs.
+
+### refLinksErrorLevel
+
+**Default value:** "ERROR"
+
- This is only relevant when running `hugo server`, and it allows to set HTTP headers during development, which allows you to test out your Content Security Policy and similar. The configuration format matches [Netlify's](https://docs.netlify.com/routing/headers/#syntax-for-the-netlify-configuration-file) with slighly more powerful [Glob matching](https://github.com/gobwas/glob):
++When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
+
+### refLinksNotFoundURL
+URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.
+
+### rssLimit
+
+Maximum number of items in the RSS feed.
+
+### sectionPagesMenu
+See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers).
+
+### sitemap
+Default [sitemap configuration](/templates/sitemap-template/#configure-sitemapxml).
+
+### summaryLength
+
+**Default value:** 70
+
+The length of text in words to show in a [`.Summary`](/content-management/summaries/#hugo-defined-automatic-summary-splitting).
+
+### taxonomies
+See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
+
+### theme
+: See [Module Config](/hugo-modules/configuration/#module-config-imports) for how to import a theme.
+
+### themesDir
+
+**Default value:** "themes"
+
+The directory where Hugo reads the themes from.
+
+### timeout
+
+**Default value:** 10000
+
+Timeout for generating page contents, in milliseconds (defaults to 10 seconds). *Note:* this is used to bail out of recursive content generation, if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents) you might need to raise this limit.
+
+### timeZone
+
+{{< new-in "0.87.0" >}}
+
+The time zone (or location), e.g. `Europe/Oslo`, used to parse front matter dates without such information and in the [`time` function](/functions/time/). The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
+
+### title
+Site title.
+
+### titleCaseStyle
+
+**Default value:** "AP"
+
+See [Configure Title Case](#configure-title-case)
+
+### uglyURLs
+When enabled, creates URL of the form `/filename.html` instead of `/filename/`.
+
+### watch
+
+Watch filesystem for changes and recreate as needed.
+
+{{% note %}}
+If you are developing your site on a \*nix machine, here is a handy shortcut for finding a configuration option from the command line:
+```
+cd ~/sites/yourhugosite
+hugo config | grep emoji
+```
+
+which shows output like
+
+```
+enableemoji: true
+```
+{{% /note %}}
+
+## Configure Build
+
+{{< new-in "0.66.0" >}}
+
+The `build` configuration section contains global build-related configuration options.
+
+{{< code-toggle file="config">}}
+[build]
+useResourceCacheWhen="fallback"
+writeStats = false
+noJSConfigInAssets = false
+{{< /code-toggle >}}
+
+
+useResourceCacheWhen
+: When to use the cached resources in `/resources/_gen` for PostCSS and ToCSS. Valid values are `never`, `always` and `fallback`. The last value means that the cache will be tried if PostCSS/extended version is not available.
+
+writeStats {{< new-in "0.69.0" >}}
+: When enabled, a file named `hugo_stats.json` will be written to your project root with some aggregated data about the build, e.g. list of HTML entities published to be used to do [CSS pruning](/hugo-pipes/postprocess/#css-purging-with-postcss). If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory). It's also worth mentioning that, due to the nature of the partial server builds, new HTML entities will be added when you add or change them while the server is running, but the old values will not be removed until you restart the server or run a regular `hugo` build.
+
+**Note** that the prime use case for this is purging of unused CSS; it is build for speed and there may be false positives (e.g. elements that isn't really a HTML element).
+
+noJSConfigInAssets {{< new-in "0.78.0" >}}
+: Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](https://gohugo.io/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
+
+## Configure Server
+
+{{< new-in "0.67.0" >}}
+
++This is only relevant when running `hugo server`, and it allows to set HTTP headers during development, which allows you to test out your Content Security Policy and similar. The configuration format matches [Netlify's](https://docs.netlify.com/routing/headers/#syntax-for-the-netlify-configuration-file) with slightly more powerful [Glob matching](https://github.com/gobwas/glob):
+
+
+{{< code-toggle file="config">}}
+[server]
+[[server.headers]]
+for = "/**.html"
+
+[server.headers.values]
+X-Frame-Options = "DENY"
+X-XSS-Protection = "1; mode=block"
+X-Content-Type-Options = "nosniff"
+Referrer-Policy = "strict-origin-when-cross-origin"
+Content-Security-Policy = "script-src localhost:1313"
+{{< /code-toggle >}}
+
+Since this is is "development only", it may make sense to put it below the `development` environment:
+
+
+{{< code-toggle file="config/development/server">}}
+[[headers]]
+for = "/**.html"
+
+[headers.values]
+X-Frame-Options = "DENY"
+X-XSS-Protection = "1; mode=block"
+X-Content-Type-Options = "nosniff"
+Referrer-Policy = "strict-origin-when-cross-origin"
+Content-Security-Policy = "script-src localhost:1313"
+{{< /code-toggle >}}
+
+
+{{< new-in "0.72.0" >}}
+
+You can also specify simple redirects rules for the server. The syntax is again similar to Netlify's.
+
+Note that a `status` code of 200 will trigger a [URL rewrite](https://docs.netlify.com/routing/redirects/rewrites-proxies/), which is what you want in SPA situations, e.g:
+
+{{< code-toggle file="config/development/server">}}
+[[redirects]]
+from = "/myspa/**"
+to = "/myspa/"
+status = 200
+force = false
+{{< /code-toggle >}}
+
+{{< new-in "0.76.0" >}} Setting `force=true` will make a redirect even if there is existing content in the path. Note that before Hugo 0.76 `force` was the default behaviour, but this is inline with how Netlify does it.
+
+## Configure Title Case
+
+Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. It defaults to [AP Stylebook](https://www.apstylebook.com/) for title casing, but you can also set it to `Chicago` or `Go` (every word starts with a capital letter).
+
+## Configuration Environment Variables
+
+HUGO_NUMWORKERMULTIPLIER
+: Can be set to increase or reduce the number of workers used in parallel processing in Hugo. If not set, the number of logical CPUs will be used.
+
+## Configuration Lookup Order
+
+Similar to the template [lookup order][], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior:
+
+1. `./config.toml`
+2. `./config.yaml`
+3. `./config.json`
+
+In your `config` file, you can direct Hugo as to how you want your website rendered, control your website's menus, and arbitrarily define site-wide parameters specific to your project.
+
+
+## Example Configuration
+
+The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]:
+
+{{< code-toggle file="config">}}
+baseURL: "https://yoursite.example.com/"
+title: "My Hugo Site"
+footnoteReturnLinkContents: "↩"
+permalinks:
+ posts: /:year/:month/:title/
+params:
+ Subtitle: "Hugo is Absurdly Fast!"
+ AuthorName: "Jon Doe"
+ GitHubUser: "spf13"
+ ListOfFoo:
+ - "foo1"
+ - "foo2"
+ SidebarRecentLimit: 5
+{{< /code-toggle >}}
+
+## Configure with Environment Variables
+
+In addition to the 3 config options already mentioned, configuration key-values can be defined through operating system environment variables.
+
+For example, the following command will effectively set a website's title on Unix-like systems:
+
+```
+$ env HUGO_TITLE="Some Title" hugo
+```
+
+This is really useful if you use a service such as Netlify to deploy your site. Look at the Hugo docs [Netlify configuration file](https://github.com/gohugoio/hugoDocs/blob/master/netlify.toml) for an example.
+
+{{% note "Setting Environment Variables" %}}
+Names must be prefixed with `HUGO_` and the configuration key must be set in uppercase when setting operating system environment variables.
+
+To set config params, prefix the name with `HUGO_PARAMS_`
+{{% /note %}}
+
+{{< new-in "0.79.0" >}} If you are using snake_cased variable names, the above will not work, so since Hugo 0.79.0 Hugo determines the delimiter to use by the first character after `HUGO`. This allows you to define environment variables on the form `HUGOxPARAMSxAPI_KEY=abcdefgh`, using any [allowed](https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names#:~:text=So%20names%20may%20contain%20any,not%20begin%20with%20a%20digit.) delimiter.
+
+{{< todo >}}
+Test and document setting params via JSON env var.
+{{< /todo >}}
+
+## Ignore Content and Data Files when Rendering
+
+To exclude specific files from the content and data directories when rendering your site, set `ignoreFiles` to one or more regular expressions.
+
+For example, to ignore content and data files ending with `.foo` and `.boo`:
+
+{{< code-toggle >}}
+ignoreFiles = [ "\\.foo$","\\.boo$"]
+{{< /code-toggle >}}
+
+## Configure Front Matter
+
+### Configure Dates
+
+Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `config.toml`.
+
+
+The default configuration is:
+
+{{< code-toggle file="config" >}}
+[frontmatter]
+date = ["date", "publishDate", "lastmod"]
+lastmod = [":git", "lastmod", "date", "publishDate"]
+publishDate = ["publishDate", "date"]
+expiryDate = ["expiryDate"]
+{{< /code-toggle >}}
+
+If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`:
+
+{{< code-toggle file="config" >}}
+[frontmatter]
+date = ["myDate", ":default"]
+{{< /code-toggle >}}
+
+The `:default` is a shortcut to the default settings. The above will set `.Date` to the date value in `myDate` if present, if not we will look in `date`,`publishDate`, `lastmod` and pick the first valid date.
+
+In the list to the right, values starting with ":" are date handlers with a special meaning (see below). The others are just names of date parameters (case insensitive) in your front matter configuration. Also note that Hugo have some built-in aliases to the above: `lastmod` => `modified`, `publishDate` => `pubdate`, `published` and `expiryDate` => `unpublishdate`. With that, as an example, using `pubDate` as a date in front matter, will, by default, be assigned to `.PublishDate`.
+
+The special date handlers are:
+
+
+`:fileModTime`
+: Fetches the date from the content file's last modification timestamp.
+
+An example:
+
+{{< code-toggle file="config" >}}
+[frontmatter]
+lastmod = ["lastmod", ":fileModTime", ":default"]
+{{< /code-toggle >}}
+
+
+The above will try first to extract the value for `.Lastmod` starting with the `lastmod` front matter parameter, then the content file's modification timestamp. The last, `:default` should not be needed here, but Hugo will finally look for a valid date in `:git`, `date` and then `publishDate`.
+
+
+`:filename`
+: Fetches the date from the content file's filename. For example, `2018-02-22-mypage.md` will extract the date `2018-02-22`. Also, if `slug` is not set, `mypage` will be used as the value for `.Slug`.
+
+An example:
+
+{{< code-toggle file="config" >}}
+[frontmatter]
+date = [":filename", ":default"]
+{{< /code-toggle >}}
+
+The above will try first to extract the value for `.Date` from the filename, then it will look in front matter parameters `date`, `publishDate` and lastly `lastmod`.
+
+
+`:git`
+: This is the Git author date for the last revision of this content file. This will only be set if `--enableGitInfo` is set or `enableGitInfo = true` is set in site config.
+
+## Configure Additional Output Formats
+
+Hugo v0.20 introduced the ability to render your content to multiple output formats (e.g., to JSON, AMP html, or CSV). See [Output Formats][] for information on how to add these values to your Hugo project's configuration file.
+
+## Configure Minify
+
+{{< new-in "0.68.0" >}}
+
+Default configuration:
+
+{{< code-toggle config="minify" />}}
+
+## Configure File Caches
+
+Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:
+
+{{< code-toggle >}}
+[caches]
+[caches.getjson]
+dir = ":cacheDir/:project"
+maxAge = -1
+[caches.getcsv]
+dir = ":cacheDir/:project"
+maxAge = -1
+[caches.images]
+dir = ":resourceDir/_gen"
+maxAge = -1
+[caches.assets]
+dir = ":resourceDir/_gen"
+maxAge = -1
+[caches.modules]
+dir = ":cacheDir/modules"
+maxAge = -1
+{{< /code-toggle >}}
+
+You can override any of these cache settings in your own `config.toml`.
+
+### The keywords explained
+
+`:cacheDir`
+: This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml).
+
+`:project`
+: The base directory name of the current Hugo project. This means that, in its default setting, every project will have separated file caches, which means that when you do `hugo --gc` you will not touch files related to other Hugo projects running on the same PC.
+
+`:resourceDir`
+: This is the value of the `resourceDir` config option.
+
+maxAge
+: This is the duration before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off. Uses Go's `time.Duration`, so valid values are `"10s"` (10 seconds), `"10m"` (10 minutes) and `"10h"` (10 hours).
+
+dir
+: The absolute path to where the files for this cache will be stored. Allowed starting placeholders are `:cacheDir` and `:resourceDir` (see above).
+
+## Configuration Format Specs
+
+* [TOML Spec][toml]
+* [YAML Spec][yaml]
+* [JSON Spec][json]
+
+[`.Site.Params`]: /variables/site/
+[directory structure]: /getting-started/directory-structure
+[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
+[lookup order]: /templates/lookup-order/
+[Output Formats]: /templates/output-formats/
+[templates]: /templates/
+[toml]: https://github.com/toml-lang/toml
+[yaml]: https://yaml.org/spec/
+[static-files]: /content-management/static-files/
--- /dev/null
- For other approaches learning Hugo like book or a video tutorial refer to the [external learning resources](/getting-started/external-learning-resources/) page.
+---
+title: Quick Start
+linktitle: Quick Start
+description: Create a Hugo site using the beautiful Ananke theme.
+date: 2013-07-01
+publishdate: 2013-07-01
+categories: [getting started]
+keywords: [quick start,usage]
+authors: [Shekhar Gulati, Ryan Watters]
+menu:
+ docs:
+ parent: "getting-started"
+ weight: 10
+weight: 10
+sections_weight: 10
+draft: false
+aliases: [/quickstart/,/overview/quickstart/]
+toc: true
+---
+
+{{% note %}}
+This quick start uses `macOS` in the examples. For instructions about how to install Hugo on other operating systems, see [install](/getting-started/installing).
+
+It is recommended to have [Git installed](https://git-scm.com/downloads) to run this tutorial.
+
- Feel free to edit or add new content and simply refresh in browser to see changes quickly (You might need to force refresh in webbrowser, something like Ctrl-R usually works).
++For other approaches to learning Hugo (like books or video tutorials), refer to the [external learning resources](/getting-started/external-learning-resources/) page.
+{{% /note %}}
+
+## Step 1: Install Hugo
+
+{{% note %}}
+`Homebrew` and `MacPorts`, package managers for `macOS`, can be installed from [brew.sh](https://brew.sh/) or [macports.org](https://www.macports.org/) respectively. See [install](/getting-started/installing) if you are running Windows etc.
+{{% /note %}}
+
+```bash
+brew install hugo
+# or
+port install hugo
+```
+
+To verify your new install:
+
+```bash
+hugo version
+```
+
+{{< asciicast ItACREbFgvJ0HjnSNeTknxWy9 >}}
+
+## Step 2: Create a New Site
+
+```bash
+hugo new site quickstart
+```
+
+The above will create a new Hugo site in a folder named `quickstart`.
+
+{{< asciicast 3mf1JGaN0AX0Z7j5kLGl3hSh8 >}}
+
+## Step 3: Add a Theme
+
+See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).
+
+First, download the theme from GitHub and add it to your site's `themes` directory:
+
+```bash
+cd quickstart
+git init
+git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
+```
+
+*Note for non-git users:*
+ - If you do not have git installed, you can download the archive of the latest
+ version of this theme from:
+ https://github.com/theNewDynamic/gohugo-theme-ananke/archive/master.zip
+ - Extract that .zip file to get a "gohugo-theme-ananke-master" directory.
+ - Rename that directory to "ananke", and move it into the "themes/" directory.
+
+Then, add the theme to the site configuration:
+
+```bash
+echo theme = \"ananke\" >> config.toml
+```
+
+{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}}
+
+## Step 4: Add Some Content
+
+You can manually create content files (for example as `content/<CATEGORY>/<FILE>.<FORMAT>`) and provide metadata in them, however you can use the `new` command to do a few things for you (like add title and date):
+
+```
+hugo new posts/my-first-post.md
+```
+
+{{< asciicast eUojYCfRTZvkEiqc52fUsJRBR >}}
+
+Edit the newly created content file if you want, it will start with something like this:
+
+```markdown
+---
+title: "My First Post"
+date: 2019-03-26T08:47:11+01:00
+draft: true
+---
+
+```
+
+{{% note %}}
+Drafts do not get deployed; once you finish a post, update the header of the post to say `draft: false`. More info [here](/getting-started/usage/#draft-future-and-expired-content).
+{{% /note %}}
+
+## Step 5: Start the Hugo server
+
+Now, start the Hugo server with [drafts](/getting-started/usage/#draft-future-and-expired-content) enabled:
+
+{{< asciicast BvJBsF6egk9c163bMsObhuNXj >}}
+
+```
+▶ hugo server -D
+
+ | EN
++------------------+----+
+ Pages | 10
+ Paginator pages | 0
+ Non-page files | 0
+ Static files | 3
+ Processed images | 0
+ Aliases | 1
+ Sitemaps | 1
+ Cleaned | 0
+
+Total in 11 ms
+Watching for changes in /Users/bep/quickstart/{content,data,layouts,static,themes}
+Watching for config changes in /Users/bep/quickstart/config.toml
+Environment: "development"
+Serving pages from memory
+Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
+Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
+Press Ctrl+C to stop
+```
+
+**Navigate to your new site at [http://localhost:1313/](http://localhost:1313/).**
+
++Feel free to edit or add new content and simply refresh in browser to see changes quickly. (You might need to force refresh your web browser, something like Ctrl-R usually works.)
+
+## Step 6: Customize the Theme
+
+Your new site already looks great, but you will want to tweak it a little before you release it to the public.
+
+### Site Configuration
+
+Open up `config.toml` in a text editor:
+
+```
+baseURL = "https://example.org/"
+languageCode = "en-us"
+title = "My New Hugo Site"
+theme = "ananke"
+```
+
+Replace the `title` above with something more personal. Also, if you already have a domain ready, set the `baseURL`. Note that this value is not needed when running the local development server.
+
+{{% note %}}
+**Tip:** Make the changes to the site configuration or any other file in your site while the Hugo server is running, and you will see the changes in the browser right away, though you may need to [clear your cache](https://kb.iu.edu/d/ahic).
+{{% /note %}}
+
+For theme specific configuration options, see the [theme site](https://github.com/theNewDynamic/gohugo-theme-ananke).
+
+**For further theme customization, see [Customize a Theme](/themes/customizing/).**
+
+### Step 7: Build static pages
+
+It is simple. Just call:
+
+```
+hugo -D
+```
+
+Output will be in `./public/` directory by default (`-d`/`--destination` flag to change it, or set `publishdir` in the config file).
+
--- /dev/null
- LiveReload is awesome for development. However, some Hugo users may use `hugo server` in production to instantly display updated content. The following methods make it easy to disable LiveReload:
+---
+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:
+ check Contains some verification checks
+ config Print the site configuration
+ convert Convert your content to different formats
+ 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
+ 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 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
+
+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/
--- /dev/null
-
+---
+title: Host on Firebase
+linktitle: Host on Firebase
+description: You can use Firebase's free tier to host your static website; this also gives you access to Firebase's NOSQL API.
+date: 2017-03-12
+publishdate: 2017-03-12
+lastmod: 2017-03-15
+categories: [hosting and deployment]
+keywords: [hosting,firebase]
+authors: [Michel Racic]
+menu:
+ docs:
+ parent: "hosting-and-deployment"
+ weight: 20
+weight: 20
+sections_weight: 20
+draft: false
+toc: true
+aliases: []
+---
+
+## Assumptions
+
+1. You have an account with [Firebase][signup]. (If you don't, you can sign up for free using your Google account.)
+2. You have completed the [Quick Start][] or have a completed Hugo website ready for deployment.
+
+## Initial setup
+
+Go to the [Firebase console][console] and create a new project (unless you already have a project). You will need to globally install `firebase-tools` (node.js):
+
- [Wercker]: /hosting-and-deployment/deployment-with-wercker/
+```
+npm install -g firebase-tools
+```
+
+Log in to Firebase (setup on your local machine) using `firebase login`, which opens a browser where you can select your account. Use `firebase logout` in case you are already logged in but to the wrong account.
+
+
+```
+firebase login
+```
+In the root of your Hugo project, initialize the Firebase project with the `firebase init` command:
+
+```
+firebase init
+```
+From here:
+
+1. Choose Hosting in the feature question
+2. Choose the project you just set up
+3. Accept the default for your database rules file
+4. Accept the default for the publish directory, which is `public`
+5. Choose "No" in the question if you are deploying a single-page app
+
+## Deploy
+
+To deploy your Hugo site, execute the `firebase deploy` command, and your site will be up in no time:
+
+```
+hugo && firebase deploy
+```
+
+## CI Setup
+
+You can generate a deploy token using
+
+
+```
+firebase login:ci
+```
+
+You can also set up your CI (e.g., with [Wercker][]) and add the token to a private variable like `$FIREBASE_DEPLOY_TOKEN`.
+
+{{% note %}}
+This is a private secret and it should not appear in a public repository. Make sure you understand your chosen CI and that it's not visible to others.
+{{% /note %}}
+
+You can then add a step in your build to do the deployment using the token:
+
+```
+firebase deploy --token $FIREBASE_DEPLOY_TOKEN
+```
+
+## Reference links
+
+* [Firebase CLI Reference](https://firebase.google.com/docs/cli/#administrative_commands)
+
+[console]: https://console.firebase.google.com
+[Quick Start]: /getting-started/quick-start/
+[signup]: https://console.firebase.google.com/
--- /dev/null
- : Default is `true`. Disable the default inline sourcemaps
+---
+title: PostCSS
+description: Hugo Pipes can process CSS files with PostCSS.
+date: 2018-07-14
+publishdate: 2018-07-14
+lastmod: 2018-07-14
+categories: [asset management]
+keywords: []
+menu:
+ docs:
+ parent: "pipes"
+ weight: 40
+weight: 40
+sections_weight: 40
+draft: false
+---
+
+Any asset file can be processed using `resources.PostCSS` which takes for argument the resource object and a slice of options listed below.
+
+The resource will be processed using the project's or theme's own `postcss.config.js` or any file set with the `config` option.
+
+```go-html-template
+{{ $css := resources.Get "css/main.css" }}
+{{ $style := $css | resources.PostCSS }}
+```
+
+{{% note %}}
+Hugo Pipe's PostCSS requires the `postcss-cli` JavaScript package to be installed in the environment (`npm install -g postcss postcss-cli`) along with any PostCSS plugin(s) used (e.g., `npm install -g autoprefixer`).
+
+If you are using the Hugo Snap package, PostCSS and plugin(s) need to be installed locally within your Hugo site directory, e.g., `npm install postcss-cli` without the `-g` flag.
+{{% /note %}}
+
+### Options
+
+config [string]
+: Path to the PostCSS configuration file
+
+noMap [bool]
++: Default is `false`. Disable the default inline sourcemaps
+
+inlineImports [bool] {{< new-in "0.66.0" >}}
+: Default is `false`. Enable inlining of @import statements. It does so recursively, but will only import a file once.
+URL imports (e.g. `@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');`) and imports with media queries will be ignored.
+Note that this import routine does not care about the CSS spec, so you can have @import anywhere in the file.
+Hugo will look for imports relative to the module mount and will respect theme overrides.
+
+_If no configuration file is used:_
+
+use [string]
+: Space-delimited list of PostCSS plugins to use
+
+parser [string]
+: Custom PostCSS parser
+
+stringifier [string]
+: Custom PostCSS stringifier
+
+syntax [string]
+: Custom postcss syntax
+
+```go-html-template
+{{ $options := dict "config" "customPostCSS.js" "noMap" true }}
+{{ $style := resources.Get "css/main.css" | resources.PostCSS $options }}
+
+{{ $options := dict "use" "autoprefixer postcss-color-alpha" }}
+{{ $style := resources.Get "css/main.css" | resources.PostCSS $options }}
+```
+
+## Check Hugo Environment from postcss.config.js
+
+{{< new-in "0.66.0" >}}
+
+The current Hugo environment name (set by `--environment` or in config or OS environment) is available in the Node context, which allows constructs like this:
+
+```js
+module.exports = {
+ plugins: [
+ require('autoprefixer'),
+ ...process.env.HUGO_ENVIRONMENT === 'production'
+ ? [purgecss]
+ : []
+ ]
+}
+```
--- /dev/null
- - Add section menu support for a [Section Menu for "the Lazy Blogger"](http://gohugo.io/extras/menus.md#section-menu-for-the-lazy-blogger")
+---
+date: 2015-05-26T01:32:45Z
+description: "The v0.14.0 Hugo release brings of the most demanded features to Hugo. The foundation of Hugo is stabilizing nicely and a lot of polish has been added. We’ve expanded support for additional content types with support for AsciiDoc, Restructured Text, HTML and Markdown."
+title: "Hugo 0.14"
+categories: ["Releases"]
+---
+
+The v0.14.0 Hugo release brings of the most demanded features to Hugo. The foundation of Hugo is stabilizing nicely and a lot of polish has been added. We’ve expanded support for additional content types with support for AsciiDoc, Restructured Text, HTML and Markdown. Some of these types depend on external libraries as there does not currently exist native support in Go. We’ve tried to make the experience as seamless as possible. Look for more improvements here in upcoming releases.
+
+A lot of work has been done to improve the user experience, with extra polish to the Windows experience. Hugo errors are more helpful overall and Hugo now can detect if it’s being run in Windows Explorer and provide additional instructions to run it via the command prompt.
+
+The Hugo community continues to grow. Hugo has over 4000 stars on github, 165 contributors, 35 themes and 1000s of happy users. It is now the 5th most popular static site generator (by Stars) and has the 3rd largest contributor community.
+
+This release represents over **240 contributions by 36 contributors** to the main Hugo codebase.
+
+Big shout out to [@bep](https://github.com/bep) who led the development of Hugo this release, [@anthonyfok](https://github.com/anthonyfok), [@eparis](https://github.com/eparis), [@SchumacherFM](https://github.com/SchumacherFM), [@RickCogley](https://github.com/RickCogley) & [@mdhender](https://github.com/mdhender) for their significant contributions and [@tatsushid](https://github.com/tatsushid) for his continuous improvements to the templates. Also a big thanks to all the theme creators. 11 new themes have been added since last release and the [hugoThemes repo now has previews of all of them](https://github.com/spf13/hugoThemes/blob/master/README.md#theme-list).
+
+Hugo also depends on a lot of other great projects. A big thanks to all of our dependencies inclding:
+[cobra](https://github.com/spf13/cobra), [viper](https://github.com/spf13/viper), [blackfriday](https://github.com/russross/blackfriday), [pflag](https://github.com/spf13/pflag), [HugoThemes](https://github.com/spf13/hugothemes), [BurntSushi/Toml](github.com/BurntSushi/toml), [goYaml](https://github.com/go-yaml/yaml/tree/v2), and the Go standard library.
+
+## New features
+- Support for all file types in content directory.
+ - If dedicated file type handler isn’t found it will be copied to the destination.
+- Add `AsciiDoc` support using external helpers.
+- Add experimental support for [`Mmark`](https://github.com/miekg/mmark) markdown processor
+- Bash autocomplete support via `genautocomplete` command
++- Add section menu support for a [Section Menu for Lazy Bloggers](https://gohugo.io/templates/menu-templates/#section-menu-for-lazy-bloggers)
+- Add support for `Ace` base templates
+- Adding `RelativeURLs = true` to site config will now make all the relative URLs relative to the content root.
+- New template functions:
+ - `getenv`
+ - The string functions `substr` and `slicestr`
+ *`seq`, a sequence generator very similar to its Gnu counterpart
+ - `absURL` and `relURL`, both of which takes the `BaseURL` setting into account
+
+## Improvements
+- Highlighting with `Pygments` is now cached to disk -- expect a major speed boost if you use it!
+- More Pygments highlighting options, including `line numbers`
+- Show help information to Windows users who try to double click on `hugo.exe`.
+- Add `bind` flag to `hugo server` to set the interface to which the server will bind
+- Add support for `canonifyurls` in `srcset`
+- Add shortcode support for HTML (content) files
+- Allow the same `shortcode` to be used with or without inline content
+- Configurable RSS output filename
+
+## Bugfixes
+- Fix panic with paginator and zero pages in result set.
+- Fix crossrefs on Windows.
+- Fix `eq` and `ne` template functions when used with a raw number combined with the result of `add`, `sub` etc.
+- Fix paginator with uglyurls
+- Fix [#998](https://github.com/spf13/hugo/issues/988), supporting UTF8 characters in Permalinks.
+
+## Notices
+- To get variable and function names in line with the rest of the Go community, a set of variable and function names has been deprecated: These will still work in 0.14, but will be removed in 0.15. What to do should be obvious by the build log; `getJson` to `getJSON`, `getCsv` to `getCSV`, `safeHtml` to `safeHTML`, `safeCss` to `safeCSS`, `safeUrl` to `safeURL`, `Url` to `URL`, `UrlPath` to `URLPath`, `BaseUrl` to `BaseURL`, `Recent` to `Pages`, `Indexes` to `Taxonomies`.
--- /dev/null
- description: "This version fixes a of bug introduced in 0.86.0."
+
+---
+date: 2021-07-30
+title: "Hugo 0.86.1: One Bug Fix"
++description: "This version fixes a bug introduced in 0.86.0."
+categories: ["Releases"]
+images:
+- images/blog/hugo-bug-poster.png
+
+---
+
+
+
+This is a bug-fix release with one important fix.
+
+* config: Fix a potential deadlock in config reading [94b616bd](https://github.com/gohugoio/hugo/commit/94b616bdfad177daa99f5e87535943f509198f6f) [@bep](https://github.com/bep) [#8791](https://github.com/gohugoio/hugo/issues/8791)
+
+
+
--- /dev/null
- title: "0.87.0"
- description: "0.87.0"
+
+---
+date: 2021-08-03
- Hugo `0.87` brings two long sought-after features: Default time zone support (per language if needed) for dates without zone offset or location info, and localized time and dates and numbers (backed by [CLDR](https://en.wikipedia.org/wiki/Common_Locale_Data_Repository)).
++title: "Localized Time and Dates and Numbers"
++description: "Hugo 0.87.0 brings time zone support, localized time and dates and numbers backed by CLDR, and more."
+categories: ["Releases"]
+---
+
- * A set of new [localized number formatting ](https://gohugo.io/functions/lang/)
++Hugo `0.87` brings two long sought-after features: Default time zone support (per language if needed) for dates without zone offset or location info, and localized time and dates and numbers (backed by [CLDR](https://en.wikipedia.org/wiki/Common_Locale_Data_Repository)).
+
+For more information, see:
+
+* The [time zone config](https://gohugo.io/getting-started/configuration/#timezone) documentation.
+* The [time.Format](https://gohugo.io/functions/dateformat/) documentation. This function will now give you localized dates (with weekdays and months in the current language). It supports all of Go's layout syntax, but also some predefined constants, e.g. `{{ .Date | time.Format ":date_long" }}`.
++* A set of new [localized number formatting ](https://gohugo.io/functions/lang/) functions.
+
+Also in this release, we have switched to using [go-toml](https://github.com/pelletier/go-toml) for all things TOML in Hugo. A big thanks to [@pelletier](https://github.com/pelletier) for his work on the `v2` version. It's both faster than what we had and [TOML v1.0.0](https://toml.io/en/v1.0.0) compliant.
+
+This release represents **40 contributions by 4 contributors** to the main Hugo code base.[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@dependabot[bot]](https://github.com/apps/dependabot), [@digitalcraftsman](https://github.com/digitalcraftsman), and [@jmooring](https://github.com/jmooring) for their ongoing contributions.
+
+Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
+which has received **1 contributions by 1 contributors**.
+
+Hugo now has:
+
+* 53261+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 430+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 395+ [themes](http://themes.gohugo.io/)
+
+
+## Notes
+
+* Deprecate Blackfriday and fix a potential deadlock in config [c7252224](https://github.com/gohugoio/hugo/commit/c7252224c4fecfe8321f31b901e2510d98b657c4) [@bep](https://github.com/bep) [#8792](https://github.com/gohugoio/hugo/issues/8792)[#8791](https://github.com/gohugoio/hugo/issues/8791)
+
+## Enhancements
+
+### Templates
+
+* Adjust tests to handle matching local time zones [9ff17c33](https://github.com/gohugoio/hugo/commit/9ff17c332405da5830cef9b3711706b1fc9a7444) [@bep](https://github.com/bep) [#8843](https://github.com/gohugoio/hugo/issues/8843)
+* Add new localized versions of lang.FormatNumber etc. [7907d24b](https://github.com/gohugoio/hugo/commit/7907d24ba16fc5a80930c1aabf5144e684ff7f29) [@bep](https://github.com/bep) [#8820](https://github.com/gohugoio/hugo/issues/8820)
+
+### Other
+
+* Make sure module config loading errors have file positioning info [d70c4857](https://github.com/gohugoio/hugo/commit/d70c485707edfd445bcfc0e84181bc15eb146e76) [@bep](https://github.com/bep) [#8845](https://github.com/gohugoio/hugo/issues/8845)
+* Remove superflous replace statement [7aaaf7e3](https://github.com/gohugoio/hugo/commit/7aaaf7e33afd05d2c74d74fbbfbd34d55e8129eb) [@bep](https://github.com/bep)
+* Reduce binary size vs locale, update to CLDR v36.1 [3a966555](https://github.com/gohugoio/hugo/commit/3a96655592d0b0db4126f20ca717d553dda9c4ed) [@bep](https://github.com/bep) [#8839](https://github.com/gohugoio/hugo/issues/8839)[#8841](https://github.com/gohugoio/hugo/issues/8841)
+* Update github.com/tdewolff/minify/v2 v2.9.20 => v2.9.21 [9a7383ca](https://github.com/gohugoio/hugo/commit/9a7383caf3945b9b11db2b108003f87e2e8b6a3a) [@jmooring](https://github.com/jmooring) [#8831](https://github.com/gohugoio/hugo/issues/8831)
+* Fail on invalid time zone [4d221ce4](https://github.com/gohugoio/hugo/commit/4d221ce468a1209ee9dd6cbece9d1273dad6a29b) [@bep](https://github.com/bep) [#8832](https://github.com/gohugoio/hugo/issues/8832)
+* Improve handling of <nil> Params [e3dc5240](https://github.com/gohugoio/hugo/commit/e3dc5240f01fd5ec67643e40f27c026d707da110) [@bep](https://github.com/bep) [#8825](https://github.com/gohugoio/hugo/issues/8825)
+* Merge branch 'release-0.86.1' [268065cb](https://github.com/gohugoio/hugo/commit/268065cb2d8339392766a23703beaf7cc49d6b5c) [@bep](https://github.com/bep)
+* bump github.com/evanw/esbuild from 0.12.16 to 0.12.17 [e90b3591](https://github.com/gohugoio/hugo/commit/e90b3591a155d1266a86c9490886720740b9d62e) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/getkin/kin-openapi from 0.67.0 to 0.68.0 [4b7da6a9](https://github.com/gohugoio/hugo/commit/4b7da6a9d720ed5ab4b45d6aa3b0b7af4683d02f) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Go back to WARNING for Page deprecations [726fe9c3](https://github.com/gohugoio/hugo/commit/726fe9c3c97a9c979dc7862e7f226fc5ec1341de) [@bep](https://github.com/bep)
+* Handle toml.LocalDate and toml.LocalDateTime in front matter [b5de37ee](https://github.com/gohugoio/hugo/commit/b5de37ee793c01f2acccdea7119be05c4182723f) [@bep](https://github.com/bep) [#8801](https://github.com/gohugoio/hugo/issues/8801)
+* Upgrade github.com/pelletier/go-toml/v2 v2.0.0-beta.3 => v2.0.0-beta.3.0.20210727221244-fa0796069526 [bf301daf](https://github.com/gohugoio/hugo/commit/bf301daf158e5e9673ad5f457ea3a264315942b5) [@bep](https://github.com/bep)
+* Switch to go-toml v2 [a3701e09](https://github.com/gohugoio/hugo/commit/a3701e09313695d4a0f6fb0eb7844c1a4befc07a) [@bep](https://github.com/bep) [#8801](https://github.com/gohugoio/hugo/issues/8801)
+* bump github.com/tdewolff/minify/v2 from 2.9.19 to 2.9.20 [40b6016c](https://github.com/gohugoio/hugo/commit/40b6016cf3f7aac541b042d32e3a162411fd9cd0) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Add a TOML front matter benchmark [7e130571](https://github.com/gohugoio/hugo/commit/7e1305710f08d26d9214abb5410ccd675e59a6e9) [@bep](https://github.com/bep)
+* Add timezone support for front matter dates without one [efa5760d](https://github.com/gohugoio/hugo/commit/efa5760db5ef39ae084bfccb5b8f756c7b117a2a) [@bep](https://github.com/bep) [#8810](https://github.com/gohugoio/hugo/issues/8810)
+* Localize time.Format [a57dda85](https://github.com/gohugoio/hugo/commit/a57dda854b5efd3429af5f0b1564fc9d9d5439b9) [@bep](https://github.com/bep) [#8797](https://github.com/gohugoio/hugo/issues/8797)
+* bump github.com/getkin/kin-openapi from 0.61.0 to 0.67.0 [f9afba93](https://github.com/gohugoio/hugo/commit/f9afba933579de07d2d2e36a457895ec5f1b7f01) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/spf13/cast from 1.3.1 to 1.4.0 [a5d2ba42](https://github.com/gohugoio/hugo/commit/a5d2ba429d34004efd3c6b82c1bcb130c85aca9c) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump google.golang.org/api from 0.45.0 to 0.51.0 [31972f36](https://github.com/gohugoio/hugo/commit/31972f3647b284eea1a66a2e27ed42d04a391a7a) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/sanity-io/litter from 1.5.0 to 1.5.1 [2e58782f](https://github.com/gohugoio/hugo/commit/2e58782f96972487dc5e5ba91d0256ec6e86dad7) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/mattn/go-isatty from 0.0.12 to 0.0.13 [7b68f652](https://github.com/gohugoio/hugo/commit/7b68f6524d24d450330cbe4a2380301e66abee4a) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/spf13/cobra from 1.1.3 to 1.2.1 [81265af2](https://github.com/gohugoio/hugo/commit/81265af2cccd3247df87f05eebf8907a14e978a4) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/mitchellh/mapstructure from 1.3.3 to 1.4.1 [c102c971](https://github.com/gohugoio/hugo/commit/c102c9719b3a29406ef59dc18eca6bd280e4dc43) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/google/go-cmp from 0.5.5 to 0.5.6 [7c0f904f](https://github.com/gohugoio/hugo/commit/7c0f904f29c41e8782b44a37fd4e98e441cd2b2c) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/mitchellh/hashstructure from 1.0.0 to 1.1.0 [b2fbd4d1](https://github.com/gohugoio/hugo/commit/b2fbd4d13a47ce3f6a56f08d0bda77e16793de72) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/gobuffalo/flect from 0.2.2 to 0.2.3 [90041d1b](https://github.com/gohugoio/hugo/commit/90041d1b6d4eeb91ea085f5a97b02887159a655b) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/pelletier/go-toml from 1.9.0 to 1.9.3 [05047096](https://github.com/gohugoio/hugo/commit/05047096f52e43ff09acbc50616441bb42a1c6f7) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/aws/aws-sdk-go from 1.38.23 to 1.40.8 [a469156e](https://github.com/gohugoio/hugo/commit/a469156ea4ad023aa4fda0d3fb657ce003412abb) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/tdewolff/minify/v2 from 2.9.18 to 2.9.19 [18fdd85b](https://github.com/gohugoio/hugo/commit/18fdd85bcc4ac2d9a33546dca8a0a24f63987361) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Update github.com/evanw/esbuild v0.11.16 => v0.12.16 [aeb1935d](https://github.com/gohugoio/hugo/commit/aeb1935d44eb258a794c8f055eedaf3a7655a3ad) [@bep](https://github.com/bep)
+* Update github.com/yuin/goldmark v1.3.9 => v1.4.0 [e09d7882](https://github.com/gohugoio/hugo/commit/e09d7882c88812bedb2c2e66b68c7eed21213dbc) [@bep](https://github.com/bep)
+* bump github.com/frankban/quicktest from 1.12.0 to 1.13.0 [15c0eed0](https://github.com/gohugoio/hugo/commit/15c0eed0487598ac1e5a6fff167b19031b6595bc) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Bump all long-living deprecations to ERRORs [91cbb963](https://github.com/gohugoio/hugo/commit/91cbb963020ac2aead68ff2bbd7e9077d5558abd) [@bep](https://github.com/bep)
+
+## Fixes
+
+### Other
+
+* Fix error handling for the time func alias [6c70e1f2](https://github.com/gohugoio/hugo/commit/6c70e1f22f365322d5f754302e110c9ed716b215) [@bep](https://github.com/bep) [#8835](https://github.com/gohugoio/hugo/issues/8835)
+* Fix a potential deadlock in config reading [94b616bd](https://github.com/gohugoio/hugo/commit/94b616bdfad177daa99f5e87535943f509198f6f) [@bep](https://github.com/bep) [#8791](https://github.com/gohugoio/hugo/issues/8791)
+* Fix theme count in release notes [a352d19d](https://github.com/gohugoio/hugo/commit/a352d19d881474f53d01791be4febd305453a9d6) [@digitalcraftsman](https://github.com/digitalcraftsman)
+
+
+
+
+
--- /dev/null
- title: "0.88.0"
- description: "0.88.0"
+
+---
+date: 2021-09-02
- The most important piece in this release is the Go 1.17 update. This release is built with that new Go version, but also and more importantly, the Hugo Modules logic has been updated to support Go's new way of (lazy) loading transitive dependencies. If you already have Go 1.17 installed, building existing Hugo Modules backed projects have not been an issue, but `hugo mod init` for a new project could give you _too new_ versions of transitive dependencies. Hugo 0.88 fixes this.
++title: "Go 1.17 Update"
++description: "Hugo 0.88.0 brings Go 1.17 support, a dependency refresh, and more."
+categories: ["Releases"]
+---
+
- * Handle nil values in time.AsTime" [abd969a6](https://github.com/gohugoio/hugo/commit/abd969a670852f9ed57c1a26434445aa985706fe) [@bep](https://github.com/bep)
++The most important piece in this release is the Go 1.17 update. This release is built with that new Go version, but also and more importantly, the Hugo Modules logic has been updated to support Go's new way of (lazy) loading transitive dependencies. If you already have Go 1.17 installed, building existing Hugo Modules backed projects have not been an issue, but `hugo mod init` for a new project could give you _too new_ versions of transitive dependencies. Hugo 0.88 fixes this.
+
+This release represents **26 contributions by 6 contributors** to the main Hugo code base.[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@dependabot[bot]](https://github.com/apps/dependabot), [@helfper](https://github.com/helfper), and [@wzshiming](https://github.com/wzshiming) for their ongoing contributions.
+
+Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
+which has received **9 contributions by 6 contributors**. A special thanks to [@bep](https://github.com/bep), [@jmooring](https://github.com/jmooring), [@StevenMaude](https://github.com/StevenMaude), and [@coliff](https://github.com/coliff) for their work on the documentation site.
+
+Hugo now has:
+
+* 53915+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 430+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 404+ [themes](http://themes.gohugo.io/)
+
+## Notes
+* We have fixed a bug with the import order in `js.Build` for the case `./foo` when both `./foo.js` and `./foo/index.js` exists. This is in line with how both Node and ESBuild's native import resolver does it. We discovered this trying to build AlpineJS v3 from source mounted in `/assets`. See [cf73cc2e](https://github.com/gohugoio/hugo/commit/cf73cc2ececd4e794df09ea382a38ab18960d84e) [@bep](https://github.com/bep) [#8945](https://github.com/gohugoio/hugo/issues/8945).
+
+## Enhancements
+
+### Templates
+
- * bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.0" [5a46eefb](https://github.com/gohugoio/hugo/commit/5a46eefbc6da3463b796ada8d15902be197455a3) [@bep](https://github.com/bep) [#8920](https://github.com/gohugoio/hugo/issues/8920)
++* Handle nil values in time.AsTime [abd969a6](https://github.com/gohugoio/hugo/commit/abd969a670852f9ed57c1a26434445aa985706fe) [@bep](https://github.com/bep)
+* Handle nil values in time.AsTime [3e110728](https://github.com/gohugoio/hugo/commit/3e11072892ca31bb76980ee38890a4bd92d83dfd) [@bep](https://github.com/bep) [#8865](https://github.com/gohugoio/hugo/issues/8865)
+
+### Other
+
+* Run go mod tidy [6631c9c7](https://github.com/gohugoio/hugo/commit/6631c9c7e00fb9dc237b4ec2fbb261d05df268d1) [@bep](https://github.com/bep)
+* Don't fail on template errors on go mod graph etc. [7d1f806e](https://github.com/gohugoio/hugo/commit/7d1f806ecb3621ae7b545a686d04de4568814055) [@bep](https://github.com/bep) [#8942](https://github.com/gohugoio/hugo/issues/8942)
+* bump github.com/getkin/kin-openapi from 0.74.0 to 0.75.0 [04b59599](https://github.com/gohugoio/hugo/commit/04b59599613a62d378bf3710ac0eb06c9543b96d) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/frankban/quicktest from 1.13.0 to 1.13.1 [c278b6e4](https://github.com/gohugoio/hugo/commit/c278b6e45d56b101db9691347f9e5a99a9319572) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/evanw/esbuild from 0.12.22 to 0.12.24 [107c86fe](https://github.com/gohugoio/hugo/commit/107c86febbb7057c4ae90c6a35b3e8eda24297c7) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Avoid failing with "module not found" for hugo mod init and similar [a0489c2d](https://github.com/gohugoio/hugo/commit/a0489c2dfd3ceb4d0702de0da7a4af3eabce05e5) [@bep](https://github.com/bep) [#8940](https://github.com/gohugoio/hugo/issues/8940)
+* Update to Go 1.17 [0fc2ce9e](https://github.com/gohugoio/hugo/commit/0fc2ce9e4bf0524994a861b7300e4332f6f8d390) [@bep](https://github.com/bep) [#8930](https://github.com/gohugoio/hugo/issues/8930)
+* Remove Pygments from snapcraft.yml [32569285](https://github.com/gohugoio/hugo/commit/32569285c181c8798ef594c12d3cfd7f9a252a04) [@anthonyfok](https://github.com/anthonyfok)
- * Prevent minifier from removing quoutes around post-processed attributes [bc0743ed](https://github.com/gohugoio/hugo/commit/bc0743ed8eafc3c2d9b21a1e8f1b05d64b85e8ba) [@bep](https://github.com/bep) [#8884](https://github.com/gohugoio/hugo/issues/8884)
- * Avoid too many watch file handles causing the server to fail to start" [ffa2fe61](https://github.com/gohugoio/hugo/commit/ffa2fe61172aa0d892234b23d1497c77a6a7f5c4) [@bep](https://github.com/bep)
++* bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.0 [5a46eefb](https://github.com/gohugoio/hugo/commit/5a46eefbc6da3463b796ada8d15902be197455a3) [@bep](https://github.com/bep) [#8920](https://github.com/gohugoio/hugo/issues/8920)
+* Add tabindex when code is not highlighted [7a15edaf](https://github.com/gohugoio/hugo/commit/7a15edafe240471c072d3548b72ccda0271ffd8f) [@helfper](https://github.com/helfper)
+* bump github.com/evanw/esbuild from 0.12.17 to 0.12.22 [2f0945ba](https://github.com/gohugoio/hugo/commit/2f0945bafe501103abe97b2f2b5566b28ec48e52) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump golang.org/x/text from 0.3.6 to 0.3.7 [7ba3f3d2](https://github.com/gohugoio/hugo/commit/7ba3f3d201e386cb9c7c15df5a6cc1c4b46473bd) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.0 [f7016524](https://github.com/gohugoio/hugo/commit/f70165242b98e3ee182fbac08bf2893a7f09e961) [@dependabot[bot]](https://github.com/apps/dependabot)
-
-
-
-
-
++* Prevent minifier from removing quotes around post-processed attributes [bc0743ed](https://github.com/gohugoio/hugo/commit/bc0743ed8eafc3c2d9b21a1e8f1b05d64b85e8ba) [@bep](https://github.com/bep) [#8884](https://github.com/gohugoio/hugo/issues/8884)
++* Avoid too many watch file handles causing the server to fail to start [ffa2fe61](https://github.com/gohugoio/hugo/commit/ffa2fe61172aa0d892234b23d1497c77a6a7f5c4) [@bep](https://github.com/bep)
+* Remove some pygments references [d966f5d0](https://github.com/gohugoio/hugo/commit/d966f5d08d7f75f1ae9acd94e292bf61de2adf0d) [@helfper](https://github.com/helfper)
+* Avoid too many watch file handles causing the server to fail to start [3f38c785](https://github.com/gohugoio/hugo/commit/3f38c785b7208440e2a9dd9a80cb39d4ae23e676) [@wzshiming](https://github.com/wzshiming) [#8904](https://github.com/gohugoio/hugo/issues/8904)
+* bump github.com/getkin/kin-openapi from 0.68.0 to 0.74.0 [24589c08](https://github.com/gohugoio/hugo/commit/24589c0814bc5d21565470bec6215ee792f1655e) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Update github.com/spf13/cast v1.4.0 => v1.4.1 [efebd756](https://github.com/gohugoio/hugo/commit/efebd756eb1f35c515ac82ccc85ec520bac91240) [@bep](https://github.com/bep) [#8891](https://github.com/gohugoio/hugo/issues/8891)
+* Import time/tzdata on Windows [58b6742c](https://github.com/gohugoio/hugo/commit/58b6742cfeb6d4cd04450cbe9592209510c2b977) [@bep](https://github.com/bep) [#8892](https://github.com/gohugoio/hugo/issues/8892)
+* Indent TOML tables [9bba9a3a](https://github.com/gohugoio/hugo/commit/9bba9a3a98fa268391597d8d7a52112fb401d952) [@bep](https://github.com/bep) [#8850](https://github.com/gohugoio/hugo/issues/8850)
+
+## Fixes
+
+### Other
+
+* Fix import order for ./foo when both ./foo.js and ./foo/index.js exists [cf73cc2e](https://github.com/gohugoio/hugo/commit/cf73cc2ececd4e794df09ea382a38ab18960d84e) [@bep](https://github.com/bep) [#8945](https://github.com/gohugoio/hugo/issues/8945)
+* Fix it so disableKinds etc. does not get merged in from theme [f4ffeea7](https://github.com/gohugoio/hugo/commit/f4ffeea71dd3d044a2628bbb5d6634680667398f) [@bep](https://github.com/bep) [#8866](https://github.com/gohugoio/hugo/issues/8866)
+* Fix `lang.FormatPercent` description [d6c8cd77](https://github.com/gohugoio/hugo/commit/d6c8cd771834ae2913658c652e30a9feadc2a7b7) [@salim-b](https://github.com/salim-b)
--- /dev/null
- title: "Hugo 0.88.1: A couple of Bug Fixes"
- description: "This version fixes a couple of bugs introduced in 0.88.0."
+
+---
+date: 2021-09-04
++title: "Hugo 0.88.1: One Fix"
++description: "This version fixes a release issue introduced in 0.88.0."
+categories: ["Releases"]
+images:
+- images/blog/hugo-bug-poster.png
+
+---
+
+
+
+This is a bug-fix release with one important fix.
+
+* Bump down again to Go 1.16.7 for the release builds [e1ead4db](https://github.com/gohugoio/hugo/commit/e1ead4dbca4cfb00ec0893c8c8563c91624ecca7) [@bep](https://github.com/bep) [#8952](https://github.com/gohugoio/hugo/issues/8952)[#8955](https://github.com/gohugoio/hugo/issues/8955)
+
+
+
--- /dev/null
- examples are: homepage, section pages, _taxonomy term_ (`/tags/`) and
- _taxonomy_ (`/tags/foo/`) pages.
+* A _regular_ page is a "post" page or a "content" page.
+ * A _leaf bundle_ is a regular page.
+* A _list_ page can list _regular_ pages and other _list_ pages. Some
++ examples are: homepage, section pages, _taxonomy_ (`/tags/`) and
++ _term_ (`/tags/foo/`) pages.
+ * A _branch bundle_ is a _list_ page.
+
+`.Site.Pages`
+: Collection of **all** pages of the site: _regular_ pages,
+ sections, taxonomies, etc. -- Superset of everything!
+
+`.Site.RegularPages`
+: Collection of only _regular_ pages.
+
+The above `.Site. ..` page collections can be accessed from any scope in
+the templates.
+
+Below variables return a collection of pages only from the scope of
+the current _list_ page:
+
+`.Pages`
+: Collection of _regular_ pages and _only first-level_
+ section pages under the current _list_ page.
+
+`.RegularPages`
+: Collection of only _regular_ pages under the
+ current _list_ page. This **excludes** regular pages in nested sections/_list_ pages (those are subdirectories with an `_index.md` file.
+
+`.RegularPagesRecursive`
+: {{< new-in "0.68.0" >}} Collection of **all** _regular_ pages under a _list_ page. This **includes** regular pages in nested sections/_list_ pages.
+
+Note
+: From the scope of _regular_ pages, `.Pages` and
+ `.RegularPages` return an empty slice.
--- /dev/null
- * Nginx. You might specify `error_page 404 /404.html;` in your `nginx.conf` file.
+---
+title: Custom 404 Page
+linktitle: 404 Page
+description: If you know how to create a single page template, you have unlimited options for creating a custom 404.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-03-31
+categories: [templates]
+keywords: [404, page not found]
+menu:
+ docs:
+ parent: "templates"
+ weight: 120
+weight: 120 #rem
+draft: false
+aliases: []
+toc: false
+---
+
+When using Hugo with [GitHub Pages](https://pages.github.com/), you can provide your own template for a [custom 404 error page](https://help.github.com/articles/custom-404-pages/) by creating a 404.html template file in your `/layouts` folder. When Hugo generates your site, the `404.html` file will be placed in the root.
+
+404 pages will have all the regular [page variables][pagevars] available to use in the templates.
+
+In addition to the standard page variables, the 404 page has access to all site content accessible from `.Pages`.
+
+```
+▾ layouts/
+ 404.html
+```
+
+## 404.html
+
+This is a basic example of a 404.html template:
+
+{{< code file="layouts/404.html" download="404.html" >}}
+{{ define "main"}}
+ <main id="main">
+ <div>
+ <h1 id="title"><a href="{{ "/" | relURL }}">Go Home</a></h1>
+ </div>
+ </main>
+{{ end }}
+{{< /code >}}
+
+## Automatic Loading
+
+Your 404.html file can be set to load automatically when a visitor enters a mistaken URL path, dependent upon the web serving environment you are using. For example:
+
+* [GitHub Pages](/hosting-and-deployment/hosting-on-github/) and [GitLab Pages](/hosting-and-deployment/hosting-on-gitlab/). The 404 page is automatic.
+* Apache. You can specify `ErrorDocument 404 /404.html` in an `.htaccess` file in the root of your site.
++* Nginx. You might specify `error_page 404 /404.html;` in your `nginx.conf` file. [Details here](https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page).
+* Amazon AWS S3. When setting a bucket up for static web serving, you can specify the error file from within the S3 GUI.
+* Amazon CloudFront. You can specify the page in the Error Pages section in the CloudFront Console. [Details here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html)
+* Caddy Server. Using `errors { 404 /404.html }`. [Details here](https://caddyserver.com/docs/errors)
+* Netlify. Add `/* /404.html 404` to `content/_redirects`. [Details Here](https://www.netlify.com/docs/redirects/#custom-404)
+* Azure Static website. You can specify the `Error document path` in the Static website configuration page of the Azure portal. [More details are available in the Static website documentation](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website).
+
+{{% note %}}
+`hugo server` will not automatically load your custom `404.html` file, but you
+can test the appearance of your custom "not found" page by navigating your
+browser to `/404.html`.
+{{% /note %}}
+
+[pagevars]: /variables/page/
--- /dev/null
- godocref:
+---
+title: DEPRECATED - Alternative Templating Languages
+linktitle: Alternative Templating
+description: DEPRECATED - Support for Ace & Amber templating has been removed in version 0.62
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-20
+categories: [templates]
+keywords: [amber,ace,templating languages]
+menu:
+ docs:
+ parent: "templates"
+ weight: 170
+weight: 170
+sections_weight: 170
+draft: false
+aliases: [/templates/ace/,/templates/amber/]
+toc: true
+---
+
+Support for Amber and Ace templates has been removed since Hugo 0.62 per [issue #6609](https://github.com/gohugoio/hugo/issues/6609).
--- /dev/null
- godocref: https://golang.org/pkg/text/template/#example_Template_block
+---
+title: Base Templates and Blocks
+linktitle:
+description: The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [templates,fundamentals]
+keywords: [blocks,base]
+menu:
+ docs:
+ parent: "templates"
+ weight: 20
+weight: 20
+sections_weight: 20
+draft: false
+aliases: [/templates/blocks/,/templates/base-templates-and-blocks/]
+toc: true
+---
+
+The `block` keyword allows you to define the outer shell of your pages' one or more master template(s) and then fill in or override portions as necessary.
+
+{{< youtube QVOMCYitLEc >}}
+
+## Base Template Lookup Order
+
+{{< new-in "0.63.0" >}} Since Hugo v0.63, the base template lookup order closely follows that of the template it applies to (e.g. `_default/list.html`).
+
+See [Template Lookup Order](/templates/lookup-order/) for details and examples.
+
+## Define the Base Template
+
+The following defines a simple base template at `_default/baseof.html`. As a default template, it is the shell from which all your pages will be rendered unless you specify another `*baseof.html` closer to the beginning of the lookup order.
+
+{{< code file="layouts/_default/baseof.html" download="baseof.html" >}}
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>{{ block "title" . }}
+ <!-- Blocks may include default content. -->
+ {{ .Site.Title }}
+ {{ end }}</title>
+ </head>
+ <body>
+ <!-- Code that all your templates share, like a header -->
+ {{ block "main" . }}
+ <!-- The part of the page that begins to differ between templates -->
+ {{ end }}
+ {{ block "footer" . }}
+ <!-- More shared code, perhaps a footer but that can be overridden if need be in -->
+ {{ end }}
+ </body>
+</html>
+{{< /code >}}
+
+## Override the Base Template
+
+From the above base template, you can define a [default list template][hugolists]. The default list template will inherit all of the code defined above and can then implement its own `"main"` block from:
+
+{{< code file="layouts/_default/list.html" download="list.html" >}}
+{{ define "main" }}
+ <h1>Posts</h1>
+ {{ range .Pages }}
+ <article>
+ <h2>{{ .Title }}</h2>
+ {{ .Content }}
+ </article>
+ {{ end }}
+{{ end }}
+{{< /code >}}
+
+This replaces the contents of our (basically empty) "main" block with something useful for the list template. In this case, we didn't define a `"title"` block, so the contents from our base template remain unchanged in lists.
+
+{{% warning %}}
+Code that you put outside the block definitions *can* break your layout. This even includes HTML comments. For example:
+
+```
+<!-- Seemingly harmless HTML comment..that will break your layout at build -->
+{{ define "main" }}
+...your code here
+{{ end }}
+```
+[See this thread from the Hugo discussion forums.](https://discourse.gohugo.io/t/baseof-html-block-templates-and-list-types-results-in-empty-pages/5612/6)
+{{% /warning %}}
+
+The following shows how you can override both the `"main"` and `"title"` block areas from the base template with code unique to your [default single page template][singletemplate]:
+
+{{< code file="layouts/_default/single.html" download="single.html" >}}
+{{ define "title" }}
+ <!-- This will override the default value set in baseof.html; i.e., "{{.Site.Title}}" in the original example-->
+ {{ .Title }} – {{ .Site.Title }}
+{{ end }}
+{{ define "main" }}
+ <h1>{{ .Title }}</h1>
+ {{ .Content }}
+{{ end }}
+{{< /code >}}
+
+[hugolists]: /templates/lists
+[lookup]: /templates/lookup-order/
+[rendering the section]: /templates/section-templates/
+[singletemplate]: /templates/single-page-templates/
--- /dev/null
- You can use the following code to render the `Short Description` in your layout::
+---
+title: Data Templates
+linktitle:
+description: In addition to Hugo's built-in variables, you can specify your own custom data in templates or shortcodes that pull from both local and dynamic sources.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-03-12
+categories: [templates]
+keywords: [data,dynamic,csv,json,toml,yaml]
+menu:
+ docs:
+ parent: "templates"
+ weight: 80
+weight: 80
+sections_weight: 80
+draft: false
+aliases: [/extras/datafiles/,/extras/datadrivencontent/,/doc/datafiles/]
+toc: true
+---
+
+<!-- begin data files -->
+
+Hugo supports loading data from YAML, JSON, and TOML files located in the `data` directory in the root of your Hugo project.
+
+{{< youtube FyPgSuwIMWQ >}}
+
+## The Data Folder
+
+The `data` folder is where you can store additional data for Hugo to use when generating your site. Data files aren't used to generate standalone pages; rather, they're meant to be supplemental to content files. This feature can extend the content in case your front matter fields grow out of control. Or perhaps you want to show a larger dataset in a template (see example below). In both cases, it's a good idea to outsource the data in their own files.
+
+These files must be YAML, JSON, or TOML files (using the `.yml`, `.yaml`, `.json`, or `.toml` extension). The data will be accessible as a `map` in the `.Site.Data` variable.
+
+## Data Files in Themes
+
+Data Files can also be used in [Hugo themes][themes] but note that theme data files follow the same logic as other template files in the [Hugo lookup order][lookup] (i.e., given two files with the same name and relative path, the file in the root project `data` directory will override the file in the `themes/<THEME>/data` directory).
+
+Therefore, theme authors should take care to not include data files that could be easily overwritten by a user who decides to [customize a theme][customize]. For theme-specific data items that shouldn't be overridden, it can be wise to prefix the folder structure with a namespace; e.g. `mytheme/data/<THEME>/somekey/...`. To check if any such duplicate exists, run hugo with the `-v` flag.
+
+The keys in the map created with data templates from data files will be a dot-chained set of `path`, `filename`, and `key` in file (if applicable).
+
+This is best explained with an example:
+
+## Example: Jaco Pastorius' Solo Discography
+
+[Jaco Pastorius](https://en.wikipedia.org/wiki/Jaco_Pastorius_discography) was a great bass player, but his solo discography is short enough to use as an example. [John Patitucci](https://en.wikipedia.org/wiki/John_Patitucci) is another bass giant.
+
+The example below is a bit contrived, but it illustrates the flexibility of data Files. This example uses TOML as its file format with the two following data files:
+
+* `data/jazz/bass/jacopastorius.toml`
+* `data/jazz/bass/johnpatitucci.toml`
+
+`jacopastorius.toml` contains the content below. `johnpatitucci.toml` contains a similar list:
+
+{{< code-toggle file="jacopastorius" >}}
+discography = [
+"1974 – Modern American Music … Period! The Criteria Sessions",
+"1974 – Jaco",
+"1976 - Jaco Pastorius",
+"1981 - Word of Mouth",
+"1981 - The Birthday Concert (released in 1995)",
+"1982 - Twins I & II (released in 1999)",
+"1983 - Invitation",
+"1986 - Broadway Blues (released in 1998)",
+"1986 - Honestly Solo Live (released in 1990)",
+"1986 - Live In Italy (released in 1991)",
+"1986 - Heavy'n Jazz (released in 1992)",
+"1991 - Live In New York City, Volumes 1-7.",
+"1999 - Rare Collection (compilation)",
+"2003 - Punk Jazz: The Jaco Pastorius Anthology (compilation)",
+"2007 - The Essential Jaco Pastorius (compilation)"
+]
+{{< /code-toggle >}}
+
+The list of bass players can be accessed via `.Site.Data.jazz.bass`, a single bass player by adding the filename without the suffix, e.g. `.Site.Data.jazz.bass.jacopastorius`.
+
+You can now render the list of recordings for all the bass players in a template:
+
+```
+{{ range $.Site.Data.jazz.bass }}
+ {{ partial "artist.html" . }}
+{{ end }}
+```
+
+And then in the `partials/artist.html`:
+
+```
+<ul>
+{{ range .discography }}
+ <li>{{ . }}</li>
+{{ end }}
+</ul>
+```
+
+Discover a new favorite bass player? Just add another `.toml` file in the same directory.
+
+## Example: Accessing Named Values in a Data File
+
+Assume you have the following data structure in your `User0123.[yml|toml|json]` data file located directly in `data/`:
+
+{{< code-toggle file="User0123" >}}
+Name: User0123
+"Short Description": "He is a **jolly good** fellow."
+Achievements:
+ - "Can create a Key, Value list from Data File"
+ - "Learns Hugo"
+ - "Reads documentation"
+{{</ code-toggle >}}
+
++You can use the following code to render the `Short Description` in your layout:
+
+```
+<div>Short Description of {{.Site.Data.User0123.Name}}: <p>{{ index .Site.Data.User0123 "Short Description" | markdownify }}</p></div>
+```
+
+Note the use of the [`markdownify` template function][markdownify]. This will send the description through the Blackfriday Markdown rendering engine.
+
+
+## Get Remote Data
+
+Use `getJSON` or `getCSV` to get remote data:
+
+```
+{{ $dataJ := getJSON "url" }}
+{{ $dataC := getCSV "separator" "url" }}
+```
+
+If you use a prefix or postfix for the URL, the functions accept [variadic arguments][variadic]:
+
+```
+{{ $dataJ := getJSON "url prefix" "arg1" "arg2" "arg n" }}
+{{ $dataC := getCSV "separator" "url prefix" "arg1" "arg2" "arg n" }}
+```
+
+The separator for `getCSV` must be put in the first position and can only be one character long.
+
+All passed arguments will be joined to the final URL:
+
+```
+{{ $urlPre := "https://api.github.com" }}
+{{ $gistJ := getJSON $urlPre "/users/GITHUB_USERNAME/gists" }}
+```
+
+This will resolve internally to the following:
+
+```
+{{ $gistJ := getJSON "https://api.github.com/users/GITHUB_USERNAME/gists" }}
+```
+
+### Add HTTP headers
+
+{{< new-in "0.84.0" >}} Both `getJSON` and `getCSV` takes an optional map as the last argument, e.g.:
+
+```
+{{ $data := getJSON "https://example.org/api" (dict "Authorization" "Bearer abcd") }}
+```
+
+If you need multiple values for the same header key, use a slice:
+
+```
+{{ $data := getJSON "https://example.org/api" (dict "X-List" (slice "a" "b" "c")) }}
+```
+
+### Example for CSV files
+
+For `getCSV`, the one-character-long separator must be placed in the first position followed by the URL. The following is an example of creating an HTML table in a [partial template][partials] from a published CSV:
+
+{{< code file="layouts/partials/get-csv.html" >}}
+ <table>
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Position</th>
+ <th>Salary</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ $url := "https://example.com/finance/employee-salaries.csv" }}
+ {{ $sep := "," }}
+ {{ range $i, $r := getCSV $sep $url }}
+ <tr>
+ <td>{{ index $r 0 }}</td>
+ <td>{{ index $r 1 }}</td>
+ <td>{{ index $r 2 }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+{{< /code >}}
+
+The expression `{{index $r number}}` must be used to output the nth-column from the current row.
+
+### Cache URLs
+
+Each downloaded URL will be cached in the default folder `$TMPDIR/hugo_cache/`. The variable `$TMPDIR` will be resolved to your system-dependent temporary directory.
+
+With the command-line flag `--cacheDir`, you can specify any folder on your system as a caching directory.
+
+You can also set `cacheDir` in the [main configuration file][config].
+
+If you don't like caching at all, you can fully disable caching with the command line flag `--ignoreCache`.
+
+### Authentication When Using REST URLs
+
+Currently, you can only use those authentication methods that can be put into an URL. [OAuth][] and other authentication methods are not implemented.
+
+## Load Local files
+
+To load local files with `getJSON` and `getCSV`, the source files must reside within Hugo's working directory. The file extension does not matter, but the content does.
+
+It applies the same output logic as above in [Call the Functions with a URL](#call-the-functions-with-a-url).
+
+{{% note %}}
+The local CSV files to be loaded using `getCSV` must be located **outside** of the `data` directory.
+{{% /note %}}
+
+## LiveReload with Data Files
+
+There is no chance to trigger a [LiveReload][] when the content of a URL changes. However, when a *local* file changes (i.e., `data/*` and `themes/<THEME>/data/*`), a LiveReload will be triggered. Symlinks are not supported. Note too that because downloading of data takes a while, Hugo stops processing your Markdown files until the data download has completed.
+
+{{% warning "URL Data and LiveReload" %}}
+If you change any local file and the LiveReload is triggered, Hugo will read the data-driven (URL) content from the cache. If you have disabled the cache (i.e., by running the server with `hugo server --ignoreCache`), Hugo will re-download the content every time LiveReload triggers. This can create *huge* traffic. You may reach API limits quickly.
+{{% /warning %}}
+
+## Examples of Data-driven Content
+
+- Photo gallery JSON powered: [https://github.com/pcdummy/hugo-lightslider-example](https://github.com/pcdummy/hugo-lightslider-example)
+- GitHub Starred Repositories [in a post](https://github.com/SchumacherFM/blog-cs/blob/master/content%2Fposts%2Fgithub-starred.md) using data-driven content in a [custom short code](https://github.com/SchumacherFM/blog-cs/blob/master/layouts%2Fshortcodes%2FghStarred.html).
+
+## Specs for Data Formats
+
+* [TOML Spec][toml]
+* [YAML Spec][yaml]
+* [JSON Spec][json]
+* [CSV Spec][csv]
+
+[config]: /getting-started/configuration/
+[csv]: https://tools.ietf.org/html/rfc4180
+[customize]: /themes/customizing/
+[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
+[LiveReload]: /getting-started/usage/#livereload
+[lookup]: /templates/lookup-order/
+[markdownify]: /functions/markdownify/
+[OAuth]: https://en.wikipedia.org/wiki/OAuth
+[partials]: /templates/partials/
+[themes]: /themes/
+[toml]: https://github.com/toml-lang/toml
+[variadic]: https://en.wikipedia.org/wiki/Variadic_function
+[vars]: /variables/
+[yaml]: https://yaml.org/spec/
--- /dev/null
- godocref: https://golang.org/pkg/os/#FileInfo
+---
+title: Local File Templates
+linktitle: Local File Templates
+description: Hugo's `readDir` and `readFile` functions make it easy to traverse your project's directory structure and write file contents to your templates.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [templates]
+keywords: [files,directories]
+menu:
+ docs:
+ parent: "templates"
+ weight: 110
+weight: 110
+sections_weight: 110
+draft: false
+aliases: [/extras/localfiles/,/templates/local-files/]
+toc: true
+---
+
+## Traverse Local Files
+
+With Hugo's [`readDir`][readDir] and [`readFile`][readFile] template functions, you can traverse your website's files on your server.
+
+## Use `readDir`
+
+The [`readDir` function][readDir] returns an array of [`os.FileInfo`][osfileinfo]. It takes the file's `path` as a single string argument. This path can be to any directory of your website (i.e., as found on your server's file system).
+
+Whether the path is absolute or relative does not matter because---at least for `readDir`---the root of your website (typically `./public/`) in effect becomes both:
+
+1. The file system root
+2. The current working directory
+
+## Use `readFile`
+
+The [`readfile` function][readFile] reads a file from disk and converts it into a string to be manipulated by other Hugo functions or added as-is. `readFile` takes the file, including path, as an argument passed to the function.
+
+To use the `readFile` function in your templates, make sure the path is relative to your *Hugo project's root directory*:
+
+```
+{{ readFile "/content/templates/local-file-templates" }}
+```
+
+### `readFile` Example: Add a Project File to Content
+
+As `readFile` is a function, it is only available to you in your templates and not your content. However, we can create a simple [shortcode template][sct] that calls `readFile`, passes the first argument through the function, and then allows an optional second argument to send the file through the Blackfriday markdown processor. The pattern for adding this shortcode to your content will be as follows:
+
+```
+{{</* readfile file="/path/to/local/file.txt" markdown="true" */>}}
+```
+
+{{% warning %}}
+If you are going to create [custom shortcodes](/templates/shortcode-templates/) with `readFile` for a theme, note that usage of the shortcode will refer to the project root and *not* your `themes` directory.
+{{% /warning %}}
+
+
+
+[called directly in the Hugo docs]: https://github.com/gohugoio/hugoDocs/blob/master/content/en/templates/files.md
+[dirindex]: https://github.com/gohugoio/hugo/blob/master/docs/layouts/shortcodes/directoryindex.html
+[osfileinfo]: https://golang.org/pkg/os/#FileInfo
+[readDir]: /functions/readdir/
+[readFile]: /functions/readfile/
+[sc]: /content-management/shortcodes/
+[sct]: /templates/shortcode-templates/
+[readfilesource]: https://github.com/gohugoio/hugoDocs/blob/master/layouts/shortcodes/readfile.html
+[testfile]: https://github.com/gohugoio/hugoDocs/blob/master/content/en/readfiles/testing.txt
--- /dev/null
- godocref: https://golang.org/pkg/html/template/
+---
+title: Introduction to Hugo Templating
+linktitle: Introduction
+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 }}
+```
+
+{{% warning %}}
+For Hugo v0.47 and older versions, variables defined inside `if`
+conditionals and similar are not visible on the outside.
+See [https://github.com/golang/go/issues/10608](https://github.com/golang/go/issues/10608).
+
+Hugo has created a workaround for this issue in [Scratch](/functions/scratch).
+{{% /warning %}}
+
+For **Hugo v0.48** and newer, variables can be re-defined using the
+new `=` operator (new in Go 1.11).
+
+Below example will work only in these newer Hugo versions. The example
+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 © 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 Only Upcoming Events
+
+Go allows you to do more than what's shown here. Using Hugo's [`where` function][where] and Go built-ins, we can list only the items from `content/events/` whose date (set in a content file's [front matter][]) is in the future. The following is an example [partial template][partials]:
+
+{{< code file="layouts/partials/upcoming-events.html" download="upcoming-events.html" >}}
+<h4>Upcoming Events</h4>
+<ul class="upcoming-events">
+{{ range where .Pages.ByDate "Section" "events" }}
+ {{ if ge .Date.Unix now.Unix }}
+ <li>
+ <!-- add span for event type -->
+ <span>{{ .Type | title }} —</span>
+ {{ .Title }} on
+ <!-- add span for event date -->
+ <span>{{ .Date.Format "2 January at 3:04pm" }}</span>
+ at {{ .Params.place }}
+ </li>
+ {{ end }}
+{{ end }}
+</ul>
+{{< /code >}}
+
+
+[`where` function]: /functions/where/
+[config]: /getting-started/configuration/
+[dotdoc]: https://golang.org/pkg/text/template/#hdr-Variables
+[first]: /functions/first/
+[front matter]: /content-management/front-matter/
+[functions]: /functions/ "See the full list of Hugo's templating functions with a quick start reference guide and basic and advanced examples."
+[Go html/template]: https://golang.org/pkg/html/template/ "Godocs references for Go's html templating"
+[gohtmltemplate]: https://golang.org/pkg/html/template/ "Godocs references for Go's html templating"
+[index]: /functions/index-function/
+[math functions]: /functions/math/
+[partials]: /templates/partials/ "Link to the partial templates page inside of the templating section of the Hugo docs"
+[internal_templates]: /templates/internal/
+[relpermalink]: /variables/page/
+[safehtml]: /functions/safehtml/
+[sitevars]: /variables/site/
+[pagevars]: /variables/page/
+[variables]: /variables/ "See the full extent of page-, site-, and other variables that Hugo make available to you in your templates."
+[where]: /functions/where/
+[with]: /functions/with/
+[godocsindex]: https://golang.org/pkg/text/template/ "Godocs page for index function"
+[param]: /functions/param/
+[isset]: /functions/isset/
--- /dev/null
- godocref:
+---
+title: Hugo's Lookup Order
+linktitle: Template Lookup Order
+description: Hugo searches for the layout to use for a given page in a well defined order, starting from the most specific.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-07-05
+categories: [templates,fundamentals]
+keywords: [templates]
+menu:
+ docs:
+ parent: "templates"
+ weight: 15
+ quicklinks:
+weight: 15
+sections_weight: 15
+draft: false
+aliases: [/templates/lookup/]
+toc: true
+---
+
+## Hugo Layouts Lookup Rules
+
+Hugo takes the parameters listed below into consideration when choosing a layout for a given page. They are listed in a priority order. This should feel natural, but look at the table below for concrete examples of the different parameter variations.
+
+
+Kind
+: The page `Kind` (the home page is one). See the example tables below per kind. This also determines if it is a **single page** (i.e. a regular content page. We then look for a template in `_default/single.html` for HTML) or a **list page** (section listings, home page, taxonomy lists, taxonomy terms. We then look for a template in `_default/list.html` for HTML).
+
+Layout
+: Can be set in page front matter.
+
+Output Format
+: See [Custom Output Formats](/templates/output-formats). An output format has both a `name` (e.g. `rss`, `amp`, `html`) and a `suffix` (e.g. `xml`, `html`). We prefer matches with both (e.g. `index.amp.html`, but look for less specific templates.
+
+Note that if the output format's Media Type has more than one suffix defined, only the first is considered.
+
+Language
+: We will consider a language code in the template name. If the site language is `fr`, `index.fr.amp.html` will win over `index.amp.html`, but `index.amp.html` will be chosen before `index.fr.html`.
+
+Type
+: Is value of `type` if set in front matter, else it is the name of the root section (e.g. "blog"). It will always have a value, so if not set, the value is "page".
+
+Section
+: Is relevant for `section`, `taxonomy` and `term` types.
+
+{{% note %}}
+**Tip:** The examples below look long and complex. That is the flexibility talking. Most Hugo sites contain just a handful of templates:
+
+```bash
+├── _default
+│ ├── baseof.html
+│ ├── list.html
+│ └── single.html
+└── index.html
+```
+{{% /note %}}
+
+
+## Hugo Layouts Lookup Rules With Theme
+
+In Hugo, layouts can live in either the project's or the themes' layout folders, and the most specific layout will be chosen. Hugo will interleave the lookups listed below, finding the most specific one either in the project or themes.
+
+## Examples: Layout Lookup for Regular Pages
+
+{{< datatable-filtered "output" "layouts" "Kind == page" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
+## Examples: Layout Lookup for Home Page
+
+{{< datatable-filtered "output" "layouts" "Kind == home" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
+## Examples: Layout Lookup for Section Pages
+
+{{< datatable-filtered "output" "layouts" "Kind == section" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
+## Examples: Layout Lookup for Taxonomy Pages
+
+{{< datatable-filtered "output" "layouts" "Kind == taxonomy" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
+## Examples: Layout Lookup for Term Pages
+
+{{< datatable-filtered "output" "layouts" "Kind == term" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
--- /dev/null
+---
+title: Custom Output Formats
+linktitle: Custom Output Formats
+description: Hugo can output content in multiple formats, including calendar events, e-book formats, Google AMP, and JSON search indexes, or any custom text format.
+date: 2017-03-22
+publishdate: 2017-03-22
+lastmod: 2019-12-11
+categories: [templates]
+keywords: ["amp","outputs","rss"]
+menu:
+ docs:
+ parent: "templates"
+ weight: 18
+weight: 18
+sections_weight: 18
+draft: false
+aliases: [/templates/outputs/,/extras/output-formats/,/content-management/custom-outputs/]
+toc: true
+---
+
+This page describes how to properly configure your site with the media types and output formats, as well as where to create your templates for your custom outputs.
+
+## Media Types
+
+A [media type][] (also known as *MIME type* and *content type*) is a two-part identifier for file formats and format contents transmitted on the Internet.
+
+This is the full set of built-in media types in Hugo:
+
+{{< datatable "media" "types" "type" "suffixes" >}}
+
+**Note:**
+
+* It is possible to add custom media types or change the defaults; e.g., if you want to change the suffix for `text/html` to `asp`.
+* `Suffixes` are the values that will be used for URLs and filenames for that media type in Hugo.
+* The `Type` is the identifier that must be used when defining new/custom `Output Formats` (see below).
+* The full set of media types will be registered in Hugo's built-in development server to make sure they are recognized by the browser.
+
+To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
+
+{{< code-toggle file="config" >}}
+[mediaTypes]
+ [mediaTypes."text/enriched"]
+ suffixes = ["enr"]
+ [mediaTypes."text/html"]
+ suffixes = ["asp"]
+{{</ code-toggle >}}
+
+The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type.
+
+**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the media type. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
+
+```toml
+[mediaTypes]
+[mediaTypes."text/html"]
+suffixes = ["htm"]
+
+# Redefine HTML to update its media type.
+[outputFormats]
+[outputFormats.HTML]
+mediaType = "text/html"
+```
+
+**Note** that for the above to work, you also need to add an `outputs` definition in your site config.
+
+## Output Format Definitions
+
+Given a media type and some additional configuration, you get an **Output Format**.
+
+This is the full set of Hugo's built-in output formats:
+
+{{< datatable "output" "formats" "name" "mediaType" "path" "baseName" "rel" "protocol" "isPlainText" "isHTML" "noUgly" "permalinkable" >}}
+
+* A page can be output in as many output formats as you want, and you can have an infinite amount of output formats defined **as long as they resolve to a unique path on the file system**. In the above table, the best example of this is `AMP` vs. `HTML`. `AMP` has the value `amp` for `Path` so it doesn't overwrite the `HTML` version; e.g. we can now have both `/index.html` and `/amp/index.html`.
+* The `MediaType` must match the `Type` of an already defined media type.
+* You can define new output formats or redefine built-in output formats; e.g., if you want to put `AMP` pages in a different path.
+
+To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
+
+{{< code-toggle file="config" >}}
+[outputFormats.MyEnrichedFormat]
+mediaType = "text/enriched"
+baseName = "myindex"
+isPlainText = true
+protocol = "bep://"
+{{</ code-toggle >}}
+
+The above example is fictional, but if used for the homepage on a site with `baseURL` `https://example.org`, it will produce a plain text homepage with the URL `bep://example.org/myindex.enr`.
+
+### Configure Output Formats
+
+The following is the full list of configuration options for output formats and their default values:
+
+`name`
+: the output format identifier. This is used to define what output format(s) you want for your pages.
+
+`mediaType`
+: this must match the `Type` of a defined media type.
+
+`path`
+: sub path to save the output files.
+
+`baseName`
+: the base filename for the list filenames (homepage, etc.). **Default:** `index`.
+
+`rel`
+: can be used to create `rel` values in `link` tags. **Default:** `alternate`.
+
+`protocol`
+: will replace the "http://" or "https://" in your `baseURL` for this output format.
+
+`isPlainText`
+: use Go's plain text templates parser for the templates. **Default:** `false`.
+
+`isHTML`
+: used in situations only relevant for `HTML`-type formats; e.g., page aliases.
+
+`noUgly`
+: used to turn off ugly URLs If `uglyURLs` is set to `true` in your site. **Default:** `false`.
+
+`notAlternative`
+: enable if it doesn't make sense to include this format in an `AlternativeOutputFormats` format listing on `Page` (e.g., with `CSS`). Note that we use the term *alternative* and not *alternate* here, as it does not necessarily replace the other format. **Default:** `false`.
+
+`permalinkable`
+: make `.Permalink` and `.RelPermalink` return the rendering Output Format rather than main ([see below](#link-to-output-formats)). This is enabled by default for `HTML` and `AMP`. **Default:** `false`.
+
++`weight`
++: Setting this to a non-zero value will be used as the first sort criteria.
++
+## Output Formats for Pages
+
+A `Page` in Hugo can be rendered to multiple *output formats* on the file
+system.
+
+### Default Output Formats
+Every `Page` has a [`Kind`][page_kinds] attribute, and the default Output
+Formats are set based on that.
+
+| Kind | Default Output Formats |
+|--------------- |----------------------- |
+| `page` | HTML |
+| `home` | HTML, RSS |
+| `section` | HTML, RSS |
+| `taxonomy` | HTML, RSS |
+| `term` | HTML, RSS |
+
+### Customizing Output Formats
+
+This can be changed by defining an `outputs` list of output formats in either
+the `Page` front matter or in the site configuration (either for all sites or
+per language).
+
+Example from site config file:
+
+{{< code-toggle file="config" >}}
+[outputs]
+ home = ["HTML", "AMP", "RSS"]
+ page = ["HTML"]
+{{</ code-toggle >}}
+
+
+Note that in the above examples, the *output formats* for `section`,
+`taxonomy` and `term` will stay at their default value `["HTML",
+"RSS"]`.
+
+{{< new-in "0.73.0" >}} We have fixed the before confusing page kinds used for taxonomies (see the listing below) to be in line with the terms used when we talk about taxonomies. We have been careful to avoid site breakage, and you should get an ERROR in the console if you need to adjust your `outputs` section.
+
+{{% page-kinds %}}
+
+* The `outputs` definition is per [`Page` `Kind`][page_kinds] (`page`, `home`, `section`, `taxonomy`, or `term`).
+* The names (e.g. `HTML`, `AMP`) used must match the `Name` of a defined *Output Format*.
+ * These names are case insensitive.
+* These can be overridden per `Page` in the front matter of content files.
+
+The following is an example of `YAML` front matter in a content file that defines output formats for the rendered `Page`:
+
+```yaml
+---
+date: "2016-03-19"
+outputs:
+- html
+- amp
+- json
+---
+```
+
+## List Output formats
+
+Each `Page` has both an `.OutputFormats` (all formats, including the current) and an `.AlternativeOutputFormats` variable, the latter of which is useful for creating a `link rel` list in your site's `<head>`:
+
+```go-html-template
+{{ range .AlternativeOutputFormats -}}
+<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
+{{ end -}}
+```
+
+## Link to Output Formats
+
+`.Permalink` and `.RelPermalink` on `Page` will return the first output format defined for that page (usually `HTML` if nothing else is defined). This is regardless of the template file they are being called from.
+
+__from `single.json.json`:__
+```go-html-template
+{{ .RelPermalink }} > /that-page/
+{{ with .OutputFormats.Get "json" -}}
+{{ .RelPermalink }} > /that-page/index.json
+{{- end }}
+```
+
+In order for them to return the output format of the current template file instead, the given output format should have its `permalinkable` setting set to true.
+
+__Same template file as above with json output format's `permalinkable` set to true:__
+
+```go-html-template
+{{ .RelPermalink }} > /that-page/index.json
+{{ with .OutputFormats.Get "html" -}}
+{{ .RelPermalink }} > /that-page/
+{{- end }}
+```
+
+From content files, you can use the [`ref` or `relref` shortcodes](/content-management/shortcodes/#ref-and-relref):
+
+```go-html-template
+[Neat]({{</* ref "blog/neat.md" "amp" */>}})
+[Who]({{</* relref "about.md#who" "amp" */>}})
+```
+
+## Templates for Your Output Formats
+
+A new output format needs a corresponding template in order to render anything useful.
+
+{{% note %}}
+The key distinction for Hugo versions 0.20 and newer is that Hugo looks at an output format's `Name` and MediaType's `Suffixes` when choosing the template used to render a given `Page`.
+{{% /note %}}
+
+The following table shows examples of different output formats, the suffix used, and Hugo's respective template [lookup order][]. All of the examples in the table can:
+
+* Use a [base template][base].
+* Include [partial templates][partials]
+
+{{< datatable "output" "layouts" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
+Hugo will now also detect the media type and output format of partials, if possible, and use that information to decide if the partial should be parsed as a plain text template or not.
+
+Hugo will look for the name given, so you can name it whatever you want. But if you want it treated as plain text, you should use the file suffix and, if needed, the name of the Output Format. The pattern is as follows:
+
+```
+[partial name].[OutputFormat].[suffix]
+```
+
+The partial below is a plain text template (Output Format is `CSV`, and since this is the only output format with the suffix `csv`, we don't need to include the Output Format's `Name`):
+
+```
+{{ partial "mytextpartial.csv" . }}
+```
+
+[base]: /templates/base/
+[config]: /getting-started/configuration/
+[lookup order]: /templates/lookup/
+[media type]: https://en.wikipedia.org/wiki/Media_type
+[partials]: /templates/partials/
+[page_kinds]: /templates/section-templates/#page-kinds
--- /dev/null
- {{< new-in "0.52.0" >}}
+---
+title: Create Your Own Shortcodes
+linktitle: Shortcode Templates
+description: You can extend Hugo's built-in shortcodes by creating your own using the same templating syntax as that for single and list pages.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [templates]
+keywords: [shortcodes,templates]
+menu:
+ docs:
+ parent: "templates"
+ weight: 100
+weight: 100
+sections_weight: 100
+draft: false
+aliases: []
+toc: true
+---
+
+Shortcodes are a means to consolidate templating into small, reusable snippets that you can embed directly inside of your content. In this sense, you can think of shortcodes as the intermediary between [page and list templates][templates] and [basic content files][].
+
+{{% note %}}
+Hugo also ships with built-in shortcodes for common use cases. (See [Content Management: Shortcodes](/content-management/shortcodes/).)
+{{% /note %}}
+
+## Create Custom Shortcodes
+
+Hugo's built-in shortcodes cover many common, but not all, use cases. Luckily, Hugo provides the ability to easily create custom shortcodes to meet your website's needs.
+
+{{< youtube Eu4zSaKOY4A >}}
+
+### File Location
+
+To create a shortcode, place an HTML template in the `layouts/shortcodes` directory of your [source organization][]. Consider the file name carefully since the shortcode name will mirror that of the file but without the `.html` extension. For example, `layouts/shortcodes/myshortcode.html` will be called with either `{{</* myshortcode /*/>}}` or `{{%/* myshortcode /*/%}}` depending on the type of parameters you choose.
+
+You can organize your shortcodes in subfolders, e.g. in `layouts/shortcodes/boxes`. These shortcodes would then be accessible with their relative path, e.g:
+
+```
+{{</* boxes/square */>}}
+```
+
+Note the forward slash.
+
+### Shortcode Template Lookup Order
+
+Shortcode templates have a simple [lookup order][]:
+
+1. `/layouts/shortcodes/<SHORTCODE>.html`
+2. `/themes/<THEME>/layouts/shortcodes/<SHORTCODE>.html`
+
+### Positional vs Named Parameters
+
+You can create shortcodes using the following types of parameters:
+
+* Positional parameters
+* Named parameters
+* Positional *or* named parameters (i.e, "flexible")
+
+In shortcodes with positional parameters, the order of the parameters is important. If a shortcode has a single required value (e.g., the `youtube` shortcode below), positional parameters work very well and require less typing from content authors.
+
+For more complex layouts with multiple or optional parameters, named parameters work best. While less terse, named parameters require less memorization from a content author and can be added in a shortcode declaration in any order.
+
+Allowing both types of parameters (i.e., a "flexible" shortcode) is useful for complex layouts where you want to set default values that can be easily overridden by users.
+
+### Access Parameters
+
+All shortcode parameters can be accessed via the `.Get` method. Whether you pass a key (i.e., string) or a number to the `.Get` method depends on whether you are accessing a named or positional parameter, respectively.
+
+To access a parameter by name, use the `.Get` method followed by the named parameter as a quoted string:
+
+```
+{{ .Get "class" }}
+```
+
+To access a parameter by position, use the `.Get` followed by a numeric position, keeping in mind that positional parameters are zero-indexed:
+
+```
+{{ .Get 0 }}
+```
+
+For the second position, you would just use:
+
+```
+{{ .Get 1 }}
+```
+
+`with` is great when the output depends on a parameter being set:
+
+```
+{{ with .Get "class" }} class="{{ . }}"{{ end }}
+```
+
+`.Get` can also be used to check if a parameter has been provided. This is
+most helpful when the condition depends on either of the values, or both:
+
+```
+{{ if or (.Get "title") (.Get "alt") }} alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "title" }}{{ end }}"{{ end }}
+```
+
+#### `.Inner`
+
+If a closing shortcode is used, the `.Inner` variable will be populated with all of the content between the opening and closing shortcodes. If a closing shortcode is required, you can check the length of `.Inner` as an indicator of its existence.
+
+A shortcode with content declared via the `.Inner` variable can also be declared without the
+content and without the closing
+by using the self-closing syntax:
+
+```
+{{</* innershortcode /*/>}}
+```
+
+#### `.Params`
+
+The `.Params` variable in shortcodes contains the list parameters passed to shortcode for more complicated use cases. You can also access higher-scoped parameters with the following logic:
+
+`$.Params`
+: these are the parameters passed directly into the shortcode declaration (e.g., a YouTube video ID)
+
+`$.Page.Params`
+: refers to the page's params; the "page" in this case refers to the content file in which the shortcode is declared (e.g., a `shortcode_color` field in a content's front matter could be accessed via `$.Page.Params.shortcode_color`).
+
+`$.Page.Site.Params`
+: refers to global variables as defined in your [site's configuration file][config].
+
+#### `.IsNamedParams`
+
+The `.IsNamedParams` variable checks whether the shortcode declaration uses named parameters and returns a boolean value.
+
+For example, you could create an `image` shortcode that can take either a `src` named parameter or the first positional parameter, depending on the preference of the content's author. Let's assume the `image` shortcode is called as follows:
+
+```
+{{</* image src="images/my-image.jpg" */>}}
+```
+
+You could then include the following as part of your shortcode templating:
+
+```
+{{ if .IsNamedParams }}
+<img src="{{ .Get "src" }}" alt="">
+{{ else }}
+<img src="{{ .Get 0 }}" alt="">
+{{ end }}
+```
+
+See the [example Vimeo shortcode][vimeoexample] below for `.IsNamedParams` in action.
+
+{{% warning %}}
+While you can create shortcode templates that accept both positional and named parameters, you *cannot* declare shortcodes in content with a mix of parameter types. Therefore, a shortcode declared like `{{</* image src="images/my-image.jpg" "This is my alt text" */>}}` will return an error.
+{{% /warning %}}
+
+You can also use the variable `.Page` to access all the normal [page variables][pagevars].
+
+A shortcodes can also be nested. In a nested shortcode, you can access the parent shortcode context with [`.Parent` variable][shortcodesvars]. This can be very useful for inheritance of common shortcode parameters from the root.
+
+### Checking for Existence
+
+You can check if a specific shortcode is used on a page by calling `.HasShortcode` in that page template, providing the name of the shortcode. This is sometimes useful when you want to include specific scripts or styles in the header that are only used by that shortcode.
+
+## Custom Shortcode Examples
+
+The following are examples of the different types of shortcodes you can create via shortcode template files in `/layouts/shortcodes`.
+
+### Single-word Example: `year`
+
+Let's assume you would like to keep mentions of your copyright year current in your content files without having to continually review your markdown. Your goal is to be able to call the shortcode as follows:
+
+```
+{{</* year */>}}
+```
+
+{{< code file="/layouts/shortcodes/year.html" >}}
+{{ now.Format "2006" }}
+{{< /code >}}
+
+### Single Positional Example: `youtube`
+
+Embedded videos are a common addition to markdown content that can quickly become unsightly. The following is the code used by [Hugo's built-in YouTube shortcode][youtubeshortcode]:
+
+```
+{{</* youtube 09jf3ow9jfw */>}}
+```
+
+Would load the template at `/layouts/shortcodes/youtube.html`:
+
+{{< code file="/layouts/shortcodes/youtube.html" >}}
+<div class="embed video-player">
+<iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/{{ index .Params 0 }}" allowfullscreen frameborder="0">
+</iframe>
+</div>
+{{< /code >}}
+
+{{< code file="youtube-embed.html" copy="false" >}}
+<div class="embed video-player">
+ <iframe class="youtube-player" type="text/html"
+ width="640" height="385"
+ src="https://www.youtube.com/embed/09jf3ow9jfw"
+ allowfullscreen frameborder="0">
+ </iframe>
+</div>
+{{< /code >}}
+
+### Single Named Example: `image`
+
+Let's say you want to create your own `img` shortcode rather than use Hugo's built-in [`figure` shortcode][figure]. Your goal is to be able to call the shortcode as follows in your content files:
+
+{{< code file="content-image.md" >}}
+{{</* img src="/media/spf13.jpg" title="Steve Francia" */>}}
+{{< /code >}}
+
+You have created the shortcode at `/layouts/shortcodes/img.html`, which loads the following shortcode template:
+
+{{< code file="/layouts/shortcodes/img.html" >}}
+<!-- image -->
+<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
+ {{ with .Get "link" }}<a href="{{ . }}">{{ end }}
+ <img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }} />
+ {{ if .Get "link" }}</a>{{ end }}
+ {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr") }}
+ <figcaption>{{ if isset .Params "title" }}
+ <h4>{{ .Get "title" }}</h4>{{ end }}
+ {{ if or (.Get "caption") (.Get "attr") }}<p>
+ {{ .Get "caption" }}
+ {{ with .Get "attrlink" }}<a href="{{ . }}"> {{ end }}
+ {{ .Get "attr" }}
+ {{ if .Get "attrlink" }}</a> {{ end }}
+ </p> {{ end }}
+ </figcaption>
+ {{ end }}
+</figure>
+<!-- image -->
+{{< /code >}}
+
+Would be rendered as:
+
+{{< code file="img-output.html" copy="false" >}}
+<figure>
+ <img src="/media/spf13.jpg" />
+ <figcaption>
+ <h4>Steve Francia</h4>
+ </figcaption>
+</figure>
+{{< /code >}}
+
+### Single Flexible Example: `vimeo`
+
+```
+{{</* vimeo 49718712 */>}}
+{{</* vimeo id="49718712" class="flex-video" */>}}
+```
+
+Would load the template found at `/layouts/shortcodes/vimeo.html`:
+
+{{< code file="/layouts/shortcodes/vimeo.html" >}}
+{{ if .IsNamedParams }}
+ <div class="{{ if .Get "class" }}{{ .Get "class" }}{{ else }}vimeo-container{{ end }}">
+ <iframe src="https://player.vimeo.com/video/{{ .Get "id" }}" allowfullscreen></iframe>
+ </div>
+{{ else }}
+ <div class="{{ if len .Params | eq 2 }}{{ .Get 1 }}{{ else }}vimeo-container{{ end }}">
+ <iframe src="https://player.vimeo.com/video/{{ .Get 0 }}" allowfullscreen></iframe>
+ </div>
+{{ end }}
+{{< /code >}}
+
+Would be rendered as:
+
+{{< code file="vimeo-iframes.html" copy="false" >}}
+<div class="vimeo-container">
+ <iframe src="https://player.vimeo.com/video/49718712" allowfullscreen></iframe>
+</div>
+<div class="flex-video">
+ <iframe src="https://player.vimeo.com/video/49718712" allowfullscreen></iframe>
+</div>
+{{< /code >}}
+
+### Paired Example: `highlight`
+
+The following is taken from `highlight`, which is a [built-in shortcode][] that ships with Hugo.
+
+{{< code file="highlight-example.md" >}}
+{{</* highlight html */>}}
+ <html>
+ <body> This HTML </body>
+ </html>
+{{</* /highlight */>}}
+{{< /code >}}
+
+The template for the `highlight` shortcode uses the following code, which is already included in Hugo:
+
+```
+{{ .Get 0 | highlight .Inner }}
+```
+
+The rendered output of the HTML example code block will be as follows:
+
+{{< code file="syntax-highlighted.html" copy="false" >}}
+<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span style="color: #f92672"><html></span>
+ <span style="color: #f92672"><body></span> This HTML <span style="color: #f92672"></body></span>
+<span style="color: #f92672"></html></span>
+</pre></div>
+{{< /code >}}
+
+### Nested Shortcode: Image Gallery
+
+Hugo's [`.Parent` shortcode variable][parent] returns a boolean value depending on whether the shortcode in question is called within the context of a *parent* shortcode. This provides an inheritance model for common shortcode parameters.
+
+The following example is contrived but demonstrates the concept. Assume you have a `gallery` shortcode that expects one named `class` parameter:
+
+{{< code file="layouts/shortcodes/gallery.html" >}}
+<div class="{{ .Get "class" }}">
+ {{ .Inner }}
+</div>
+{{< /code >}}
+
+You also have an `img` shortcode with a single named `src` parameter that you want to call inside of `gallery` and other shortcodes, so that the parent defines the context of each `img`:
+
+{{< code file="layouts/shortcodes/img.html" >}}
+{{- $src := .Get "src" -}}
+{{- with .Parent -}}
+ <img src="{{$src}}" class="{{ .Get "class" }}-image">
+{{- else -}}
+ <img src="{{$src}}">
+{{- end -}}
+{{< /code >}}
+
+You can then call your shortcode in your content as follows:
+
+```
+{{</* gallery class="content-gallery" */>}}
+ {{</* img src="/images/one.jpg" */>}}
+ {{</* img src="/images/two.jpg" */>}}
+{{</* /gallery */>}}
+{{</* img src="/images/three.jpg" */>}}
+```
+
+This will output the following HTML. Note how the first two `img` shortcodes inherit the `class` value of `content-gallery` set with the call to the parent `gallery`, whereas the third `img` only uses `src`:
+
+```
+<div class="content-gallery">
+ <img src="/images/one.jpg" class="content-gallery-image">
+ <img src="/images/two.jpg" class="content-gallery-image">
+</div>
+<img src="/images/three.jpg">
+```
+
+
+## Error Handling in Shortcodes
+
+Use the [errorf](/functions/errorf) template func and [.Position](/variables/shortcodes/) variable to get useful error messages in shortcodes:
+
+```bash
+{{ with .Get "name" }}
+{{ else }}
+{{ errorf "missing value for param 'name': %s" .Position }}
+{{ end }}
+```
+
+When the above fails, you will see an `ERROR` log similar to the below:
+
+```bash
+ERROR 2018/11/07 10:05:55 missing value for param name: "/Users/bep/dev/go/gohugoio/hugo/docs/content/en/variables/shortcodes.md:32:1"
+```
+
+## More Shortcode Examples
+
+More shortcode examples can be found in the [shortcodes directory for spf13.com][spfscs] and the [shortcodes directory for the Hugo docs][docsshortcodes].
+
+
+## Inline Shortcodes
+
++{{< new-in "0.52" >}}
+
+Since Hugo 0.52, you can implement your shortcodes inline -- e.g. where you use them in the content file. This can be useful for scripting that you only need in one place.
+
+This feature is disabled by default, but can be enabled in your site config:
+
+{{< code-toggle file="config">}}
+enableInlineShortcodes = true
+{{< /code-toggle >}}
+
+It is disabled by default for security reasons. The security model used by Hugo's template handling assumes that template authors are trusted, but that the content files are not, so the templates are injection-safe from malformed input data. But in most situations you have full control over the content, too, and then `enableInlineShortcodes = true` would be considered safe. But it's something to be aware of: It allows ad-hoc [Go Text templates](https://golang.org/pkg/text/template/) to be executed from the content files.
+
+And once enabled, you can do this in your content files:
+
+ ```go-text-template
+ {{</* time.inline */>}}{{ now }}{{</* /time.inline */>}}
+ ```
+
+The above will print the current date and time.
+
+ Note that an inline shortcode's inner content is parsed and executed as a Go text template with the same context as a regular shortcode template.
+
+This means that the current page can be accessed via `.Page.Title` etc. This also means that there are no concept of "nested inline shortcodes".
+
+The same inline shortcode can be reused later in the same content file, with different params if needed, using the self-closing syntax:
+
+ ```go-text-template
+{{</* time.inline /*/>}}
+```
+
+
+[basic content files]: /content-management/formats/ "See how Hugo leverages markdown--and other supported formats--to create content for your website."
+[built-in shortcode]: /content-management/shortcodes/
+[config]: /getting-started/configuration/ "Learn more about Hugo's built-in configuration variables as well as how to us your site's configuration file to include global key-values that can be used throughout your rendered website."
+[Content Management: Shortcodes]: /content-management/shortcodes/#using-hugo-s-built-in-shortcodes "Check this section if you are not familiar with the definition of what a shortcode is or if you are unfamiliar with how to use Hugo's built-in shortcodes in your content files."
+[source organization]: /getting-started/directory-structure/#directory-structure-explained "Learn how Hugo scaffolds new sites and what it expects to find in each of your directories."
+[docsshortcodes]: https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes "See the shortcode source directory for the documentation site you're currently reading."
+[figure]: /content-management/shortcodes/#figure
+[hugosc]: /content-management/shortcodes/#using-hugo-s-built-in-shortcodes
+[lookup order]: /templates/lookup-order/ "See the order in which Hugo traverses your template files to decide where and how to render your content at build time"
+[pagevars]: /variables/page/ "See which variables you can leverage in your templating for page vs list templates."
+[parent]: /variables/shortcodes/
+[shortcodesvars]: /variables/shortcodes/ "Certain variables are specific to shortcodes, although most .Page variables can be accessed within your shortcode template."
+[spfscs]: https://github.com/spf13/spf13.com/tree/master/layouts/shortcodes "See more examples of shortcodes by visiting the shortcode directory of the source for spf13.com, the blog of Hugo's creator, Steve Francia."
+[templates]: /templates/ "The templates section of the Hugo docs."
+[vimeoexample]: #single-flexible-example-vimeo
+[youtubeshortcode]: /content-management/shortcodes/#youtube "See how to use Hugo's built-in YouTube shortcode."
--- /dev/null
- godocref: https://golang.org/pkg/fmt/
+---
+title: Template Debugging
+# linktitle: Template Debugging
+description: You can use Go templates' `printf` function to debug your Hugo templates. These snippets provide a quick and easy visualization of the variables available to you in different contexts.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [templates]
+keywords: [debugging,troubleshooting]
+menu:
+ docs:
+ parent: "templates"
+ weight: 180
+weight: 180
+sections_weight: 180
+draft: false
+aliases: []
+toc: false
+---
+
+Here are some snippets you can add to your template to answer some common questions.
+
+These snippets use the `printf` function available in all Go templates. This function is an alias to the Go function, [fmt.Printf](https://golang.org/pkg/fmt/).
+
+## What Variables are Available in this Context?
+
+You can use the template syntax, `$.`, to get the top-level template context from anywhere in your template. This will print out all the values under, `.Site`.
+
+```
+{{ printf "%#v" $.Site }}
+```
+
+This will print out the value of `.Permalink`:
+
+
+```
+{{ printf "%#v" .Permalink }}
+```
+
+
+This will print out a list of all the variables scoped to the current context
+(`.`, aka ["the dot"][tempintro]).
+
+
+```
+{{ printf "%#v" . }}
+```
+
+
+When developing a [homepage][], what does one of the pages you're looping through look like?
+
+```
+{{ range .Pages }}
+ {{/* The context, ".", is now each one of the pages as it goes through the loop */}}
+ {{ printf "%#v" . }}
+{{ end }}
+```
+
+## Why Am I Showing No Defined Variables?
+
+Check that you are passing variables in the `partial` function:
+
+```
+{{ partial "header" }}
+```
+
+This example will render the header partial, but the header partial will not have access to any contextual variables. You need to pass variables explicitly. For example, note the addition of ["the dot"][tempintro].
+
+```
+{{ partial "header" . }}
+```
+
+The dot (`.`) is considered fundamental to understanding Hugo templating. For more information, see [Introduction to Hugo Templating][tempintro].
+
+[homepage]: /templates/homepage/
+[tempintro]: /templates/introduction/
--- /dev/null
- godocref: https://golang.org/pkg/text/template/#example_Template_block
+---
+title: Base 模板 and Blocks
+linktitle:
+description: The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).
+date: 2017-02-01
+publishdate: 2018-08-11
+lastmod: 2017-02-01
+categories: [templates,fundamentals]
+keywords: [blocks,base]
+menu:
+ docs:
+ parent: "templates"
+ weight: 20
+weight: 20
+sections_weight: 20
+draft: false
+aliases: [/templates/blocks/,/templates/base-templates-and-blocks/]
+toc: true
+---
+
+The `block` keyword allows you to define the outer shell of your pages' one or more master template(s) and then fill in or override portions as necessary.
+
+{{< youtube QVOMCYitLEc >}}
+
+## Base Template Lookup Order
+
+The [lookup order][lookup] for base templates is as follows:
+
+1. `/layouts/section/<TYPE>-baseof.html`
+2. `/themes/<THEME>/layouts/section/<TYPE>-baseof.html`
+3. `/layouts/<TYPE>/baseof.html`
+4. `/themes/<THEME>/layouts/<TYPE>/baseof.html`
+5. `/layouts/section/baseof.html`
+6. `/themes/<THEME>/layouts/section/baseof.html`
+7. `/layouts/_default/<TYPE>-baseof.html`
+8. `/themes/<THEME>/layouts/_default/<TYPE>-baseof.html`
+9. `/layouts/_default/baseof.html`
+10. `/themes/<THEME>/layouts/_default/baseof.html`
+
+Variables are denoted by capitalized text set within `<>`. Note that Hugo's default behavior is for `type` to inherit from `section` unless otherwise specified.
+
+### Example Base Template Lookup Order
+
+As an example, let's assume your site is using a theme called "mytheme" when rendering the section list for a `posts` section. Hugo picks `layout/section/posts.html` as the template for [rendering the section][]. The `{{define}}` block in this template tells Hugo that the template is an extension of a base template.
+
+Here is the lookup order for the `posts` base template:
+
+1. `/layouts/section/posts-baseof.html`
+2. `/themes/mytheme/layouts/section/posts-baseof.html`
+3. `/layouts/posts/baseof.html`
+4. `/themes/mytheme/layouts/posts/baseof.html`
+5. `/layouts/section/baseof.html`
+6. `/themes/mytheme/layouts/section/baseof.html`
+7. `/layouts/_default/posts-baseof.html`
+8. `/themes/mytheme/layouts/_default/posts-baseof.html`
+9. `/layouts/_default/baseof.html`
+10. `/themes/mytheme/layouts/_default/baseof.html`
+
+## Define the Base Template
+
+The following defines a simple base template at `_default/baseof.html`. As a default template, it is the shell from which all your pages will be rendered unless you specify another `*baseof.html` closer to the beginning of the lookup order.
+
+{{< code file="layouts/_default/baseof.html" download="baseof.html" >}}
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>{{ block "title" . }}
+ <!-- Blocks may include default content. -->
+ {{ .Site.Title }}
+ {{ end }}</title>
+ </head>
+ <body>
+ <!-- Code that all your templates share, like a header -->
+ {{ block "main" . }}
+ <!-- The part of the page that begins to differ between templates -->
+ {{ end }}
+ {{ block "footer" . }}
+ <!-- More shared code, perhaps a footer but that can be overridden if need be in -->
+ {{ end }}
+ </body>
+</html>
+{{< /code >}}
+
+## Override the Base Template
+
+From the above base template, you can define a [default list template][hugolists]. The default list template will inherit all of the code defined above and can then implement its own `"main"` block from:
+
+{{< code file="layouts/_default/list.html" download="list.html" >}}
+{{ define "main" }}
+ <h1>Posts</h1>
+ {{ range .Pages }}
+ <article>
+ <h2>{{ .Title }}</h2>
+ {{ .Content }}
+ </article>
+ {{ end }}
+{{ end }}
+{{< /code >}}
+
+This replaces the contents of our (basically empty) "main" block with something useful for the list template. In this case, we didn't define a `"title"` block, so the contents from our base template remain unchanged in lists.
+
+{{% warning %}}
+Code that you put outside the block definitions *can* break your layout. This even includes HTML comments. For example:
+
+```
+<!-- Seemingly harmless HTML comment..that will break your layout at build -->
+{{ define "main" }}
+...your code here
+{{ end }}
+```
+[See this thread from the Hugo discussion forums.](https://discourse.gohugo.io/t/baseof-html-block-templates-and-list-types-results-in-empty-pages/5612/6)
+{{% /warning %}}
+
+The following shows how you can override both the `"main"` and `"title"` block areas from the base template with code unique to your [default single page template][singletemplate]:
+
+{{< code file="layouts/_default/single.html" download="single.html" >}}
+{{ define "title" }}
+ <!-- This will override the default value set in baseof.html; i.e., "{{.Site.Title}}" in the original example-->
+ {{ .Title }} – {{ .Site.Title }}
+{{ end }}
+{{ define "main" }}
+ <h1>{{ .Title }}</h1>
+ {{ .Content }}
+{{ end }}
+{{< /code >}}
+
+[hugolists]: /templates/lists
+[lookup]: /templates/lookup-order/
+[rendering the section]: /templates/section-templates/
+[singletemplate]: /templates/single-page-templates/
--- /dev/null
- "Description": "FormatPercent formats number with the given precision for the current language.\nNote that the number is assumbed to be percent.",
+{
+ "chroma": {
+ "lexers": [
+ {
+ "Name": "ABAP",
+ "Aliases": [
+ "ABAP",
+ "abap"
+ ]
+ },
+ {
+ "Name": "ABNF",
+ "Aliases": [
+ "abnf"
+ ]
+ },
+ {
+ "Name": "ActionScript",
+ "Aliases": [
+ "actionscript",
+ "as"
+ ]
+ },
+ {
+ "Name": "ActionScript 3",
+ "Aliases": [
+ "actionscript3",
+ "as",
+ "as3"
+ ]
+ },
+ {
+ "Name": "Ada",
+ "Aliases": [
+ "ada",
+ "ada2005",
+ "ada95",
+ "adb",
+ "ads"
+ ]
+ },
+ {
+ "Name": "AL",
+ "Aliases": [
+ "al",
+ "dal"
+ ]
+ },
+ {
+ "Name": "Angular2",
+ "Aliases": [
+ "ng2"
+ ]
+ },
+ {
+ "Name": "ANTLR",
+ "Aliases": [
+ "antlr"
+ ]
+ },
+ {
+ "Name": "ApacheConf",
+ "Aliases": [
+ "aconf",
+ "apache",
+ "apacheconf",
+ "conf",
+ "htaccess"
+ ]
+ },
+ {
+ "Name": "APL",
+ "Aliases": [
+ "apl"
+ ]
+ },
+ {
+ "Name": "AppleScript",
+ "Aliases": [
+ "applescript"
+ ]
+ },
+ {
+ "Name": "Arduino",
+ "Aliases": [
+ "arduino",
+ "ino"
+ ]
+ },
+ {
+ "Name": "Awk",
+ "Aliases": [
+ "awk",
+ "gawk",
+ "mawk",
+ "nawk"
+ ]
+ },
+ {
+ "Name": "Ballerina",
+ "Aliases": [
+ "bal",
+ "ballerina"
+ ]
+ },
+ {
+ "Name": "Base Makefile",
+ "Aliases": [
+ "*",
+ "bsdmake",
+ "mak",
+ "make",
+ "makefile",
+ "mf",
+ "mk"
+ ]
+ },
+ {
+ "Name": "Bash",
+ "Aliases": [
+ "bash",
+ "bash_*",
+ "bashrc",
+ "ebuild",
+ "eclass",
+ "env",
+ "exheres-0",
+ "exlib",
+ "ksh",
+ "sh",
+ "shell",
+ "zsh",
+ "zshrc"
+ ]
+ },
+ {
+ "Name": "Batchfile",
+ "Aliases": [
+ "bat",
+ "batch",
+ "cmd",
+ "dosbatch",
+ "winbatch"
+ ]
+ },
+ {
+ "Name": "BibTeX",
+ "Aliases": [
+ "bib",
+ "bibtex"
+ ]
+ },
+ {
+ "Name": "BlitzBasic",
+ "Aliases": [
+ "b3d",
+ "bb",
+ "blitzbasic",
+ "bplus",
+ "decls"
+ ]
+ },
+ {
+ "Name": "BNF",
+ "Aliases": [
+ "bnf"
+ ]
+ },
+ {
+ "Name": "Brainfuck",
+ "Aliases": [
+ "b",
+ "bf",
+ "brainfuck"
+ ]
+ },
+ {
+ "Name": "C",
+ "Aliases": [
+ "c",
+ "h",
+ "idc",
+ "x[bp]m"
+ ]
+ },
+ {
+ "Name": "C#",
+ "Aliases": [
+ "c#",
+ "cs",
+ "csharp"
+ ]
+ },
+ {
+ "Name": "C++",
+ "Aliases": [
+ "C",
+ "CPP",
+ "H",
+ "c++",
+ "cc",
+ "cp",
+ "cpp",
+ "cxx",
+ "h++",
+ "hh",
+ "hpp",
+ "hxx"
+ ]
+ },
+ {
+ "Name": "Caddyfile",
+ "Aliases": [
+ "caddy",
+ "caddyfile"
+ ]
+ },
+ {
+ "Name": "Caddyfile Directives",
+ "Aliases": [
+ "caddy-d",
+ "caddyfile-d",
+ "caddyfile-directives"
+ ]
+ },
+ {
+ "Name": "Cap'n Proto",
+ "Aliases": [
+ "capnp"
+ ]
+ },
+ {
+ "Name": "Cassandra CQL",
+ "Aliases": [
+ "cassandra",
+ "cql"
+ ]
+ },
+ {
+ "Name": "Ceylon",
+ "Aliases": [
+ "ceylon"
+ ]
+ },
+ {
+ "Name": "CFEngine3",
+ "Aliases": [
+ "cf",
+ "cf3",
+ "cfengine3"
+ ]
+ },
+ {
+ "Name": "cfstatement",
+ "Aliases": [
+ "cfs"
+ ]
+ },
+ {
+ "Name": "ChaiScript",
+ "Aliases": [
+ "chai",
+ "chaiscript"
+ ]
+ },
+ {
+ "Name": "Cheetah",
+ "Aliases": [
+ "cheetah",
+ "spitfire",
+ "spt",
+ "tmpl"
+ ]
+ },
+ {
+ "Name": "Clojure",
+ "Aliases": [
+ "clj",
+ "clojure"
+ ]
+ },
+ {
+ "Name": "CMake",
+ "Aliases": [
+ "cmake",
+ "txt"
+ ]
+ },
+ {
+ "Name": "COBOL",
+ "Aliases": [
+ "COB",
+ "CPY",
+ "cob",
+ "cobol",
+ "cpy"
+ ]
+ },
+ {
+ "Name": "CoffeeScript",
+ "Aliases": [
+ "coffee",
+ "coffee-script",
+ "coffeescript"
+ ]
+ },
+ {
+ "Name": "Common Lisp",
+ "Aliases": [
+ "cl",
+ "common-lisp",
+ "lisp"
+ ]
+ },
+ {
+ "Name": "Coq",
+ "Aliases": [
+ "coq",
+ "v"
+ ]
+ },
+ {
+ "Name": "Crystal",
+ "Aliases": [
+ "cr",
+ "crystal"
+ ]
+ },
+ {
+ "Name": "CSS",
+ "Aliases": [
+ "css"
+ ]
+ },
+ {
+ "Name": "Cython",
+ "Aliases": [
+ "cython",
+ "pxd",
+ "pxi",
+ "pyrex",
+ "pyx"
+ ]
+ },
+ {
+ "Name": "D",
+ "Aliases": [
+ "d",
+ "di"
+ ]
+ },
+ {
+ "Name": "Dart",
+ "Aliases": [
+ "dart"
+ ]
+ },
+ {
+ "Name": "Diff",
+ "Aliases": [
+ "diff",
+ "patch",
+ "udiff"
+ ]
+ },
+ {
+ "Name": "Django/Jinja",
+ "Aliases": [
+ "django",
+ "jinja"
+ ]
+ },
+ {
+ "Name": "Docker",
+ "Aliases": [
+ "docker",
+ "dockerfile"
+ ]
+ },
+ {
+ "Name": "DTD",
+ "Aliases": [
+ "dtd"
+ ]
+ },
+ {
+ "Name": "Dylan",
+ "Aliases": [
+ "dyl",
+ "dylan",
+ "intr"
+ ]
+ },
+ {
+ "Name": "EBNF",
+ "Aliases": [
+ "ebnf"
+ ]
+ },
+ {
+ "Name": "Elixir",
+ "Aliases": [
+ "elixir",
+ "ex",
+ "exs"
+ ]
+ },
+ {
+ "Name": "Elm",
+ "Aliases": [
+ "elm"
+ ]
+ },
+ {
+ "Name": "EmacsLisp",
+ "Aliases": [
+ "el",
+ "elisp",
+ "emacs",
+ "emacs-lisp"
+ ]
+ },
+ {
+ "Name": "Erlang",
+ "Aliases": [
+ "erl",
+ "erlang",
+ "es",
+ "escript",
+ "hrl"
+ ]
+ },
+ {
+ "Name": "Factor",
+ "Aliases": [
+ "factor"
+ ]
+ },
+ {
+ "Name": "Fish",
+ "Aliases": [
+ "fish",
+ "fishshell",
+ "load"
+ ]
+ },
+ {
+ "Name": "Forth",
+ "Aliases": [
+ "forth",
+ "frt",
+ "fs",
+ "fth"
+ ]
+ },
+ {
+ "Name": "Fortran",
+ "Aliases": [
+ "F03",
+ "F90",
+ "f03",
+ "f90",
+ "fortran"
+ ]
+ },
+ {
+ "Name": "FortranFixed",
+ "Aliases": [
+ "F",
+ "f",
+ "fortranfixed"
+ ]
+ },
+ {
+ "Name": "FSharp",
+ "Aliases": [
+ "fs",
+ "fsharp",
+ "fsi"
+ ]
+ },
+ {
+ "Name": "GAS",
+ "Aliases": [
+ "S",
+ "asm",
+ "gas",
+ "s"
+ ]
+ },
+ {
+ "Name": "GDScript",
+ "Aliases": [
+ "gd",
+ "gdscript"
+ ]
+ },
+ {
+ "Name": "Genshi",
+ "Aliases": [
+ "genshi",
+ "kid",
+ "xml+genshi",
+ "xml+kid"
+ ]
+ },
+ {
+ "Name": "Genshi HTML",
+ "Aliases": [
+ "html+genshi",
+ "html+kid"
+ ]
+ },
+ {
+ "Name": "Genshi Text",
+ "Aliases": [
+ "genshitext"
+ ]
+ },
+ {
+ "Name": "Gherkin",
+ "Aliases": [
+ "Cucumber",
+ "FEATURE",
+ "Gherkin",
+ "cucumber",
+ "feature",
+ "gherkin"
+ ]
+ },
+ {
+ "Name": "GLSL",
+ "Aliases": [
+ "frag",
+ "geo",
+ "glsl",
+ "vert"
+ ]
+ },
+ {
+ "Name": "Gnuplot",
+ "Aliases": [
+ "gnuplot",
+ "plot",
+ "plt"
+ ]
+ },
+ {
+ "Name": "Go",
+ "Aliases": [
+ "go",
+ "golang"
+ ]
+ },
+ {
+ "Name": "Go HTML Template",
+ "Aliases": [
+ "go-html-template"
+ ]
+ },
+ {
+ "Name": "Go Text Template",
+ "Aliases": [
+ "go-text-template"
+ ]
+ },
+ {
+ "Name": "GraphQL",
+ "Aliases": [
+ "gql",
+ "graphql",
+ "graphqls"
+ ]
+ },
+ {
+ "Name": "Groff",
+ "Aliases": [
+ "1p",
+ "3pm",
+ "[1-9]",
+ "groff",
+ "man",
+ "nroff"
+ ]
+ },
+ {
+ "Name": "Groovy",
+ "Aliases": [
+ "gradle",
+ "groovy"
+ ]
+ },
+ {
+ "Name": "Handlebars",
+ "Aliases": [
+ "handlebars",
+ "hbs"
+ ]
+ },
+ {
+ "Name": "Haskell",
+ "Aliases": [
+ "haskell",
+ "hs"
+ ]
+ },
+ {
+ "Name": "Haxe",
+ "Aliases": [
+ "haxe",
+ "hx",
+ "hxsl"
+ ]
+ },
+ {
+ "Name": "HCL",
+ "Aliases": [
+ "hcl"
+ ]
+ },
+ {
+ "Name": "Hexdump",
+ "Aliases": [
+ "hexdump"
+ ]
+ },
+ {
+ "Name": "HLB",
+ "Aliases": [
+ "hlb"
+ ]
+ },
+ {
+ "Name": "HTML",
+ "Aliases": [
+ "htm",
+ "html",
+ "xhtml",
+ "xslt"
+ ]
+ },
+ {
+ "Name": "HTTP",
+ "Aliases": [
+ "http"
+ ]
+ },
+ {
+ "Name": "Hy",
+ "Aliases": [
+ "hy",
+ "hylang"
+ ]
+ },
+ {
+ "Name": "Idris",
+ "Aliases": [
+ "idr",
+ "idris"
+ ]
+ },
+ {
+ "Name": "Igor",
+ "Aliases": [
+ "igor",
+ "igorpro",
+ "ipf"
+ ]
+ },
+ {
+ "Name": "INI",
+ "Aliases": [
+ "cfg",
+ "dosini",
+ "editorconfig",
+ "gitconfig",
+ "inf",
+ "ini"
+ ]
+ },
+ {
+ "Name": "Io",
+ "Aliases": [
+ "io"
+ ]
+ },
+ {
+ "Name": "J",
+ "Aliases": [
+ "ijs",
+ "j"
+ ]
+ },
+ {
+ "Name": "Java",
+ "Aliases": [
+ "java"
+ ]
+ },
+ {
+ "Name": "JavaScript",
+ "Aliases": [
+ "javascript",
+ "js",
+ "jsm",
+ "mjs"
+ ]
+ },
+ {
+ "Name": "JSON",
+ "Aliases": [
+ "json"
+ ]
+ },
+ {
+ "Name": "Julia",
+ "Aliases": [
+ "jl",
+ "julia"
+ ]
+ },
+ {
+ "Name": "Jungle",
+ "Aliases": [
+ "jungle"
+ ]
+ },
+ {
+ "Name": "Kotlin",
+ "Aliases": [
+ "kotlin",
+ "kt"
+ ]
+ },
+ {
+ "Name": "Lighttpd configuration file",
+ "Aliases": [
+ "lighttpd",
+ "lighty"
+ ]
+ },
+ {
+ "Name": "LLVM",
+ "Aliases": [
+ "ll",
+ "llvm"
+ ]
+ },
+ {
+ "Name": "Lua",
+ "Aliases": [
+ "lua",
+ "wlua"
+ ]
+ },
+ {
+ "Name": "Mako",
+ "Aliases": [
+ "mako",
+ "mao"
+ ]
+ },
+ {
+ "Name": "markdown",
+ "Aliases": [
+ "markdown",
+ "md",
+ "mkd"
+ ]
+ },
+ {
+ "Name": "Mason",
+ "Aliases": [
+ "m",
+ "mason",
+ "mc",
+ "mhtml",
+ "mi"
+ ]
+ },
+ {
+ "Name": "Mathematica",
+ "Aliases": [
+ "cdf",
+ "ma",
+ "mathematica",
+ "mma",
+ "nb",
+ "nbp"
+ ]
+ },
+ {
+ "Name": "Matlab",
+ "Aliases": [
+ "m",
+ "matlab"
+ ]
+ },
+ {
+ "Name": "mcfunction",
+ "Aliases": [
+ "mcfunction"
+ ]
+ },
+ {
+ "Name": "Metal",
+ "Aliases": [
+ "metal"
+ ]
+ },
+ {
+ "Name": "MiniZinc",
+ "Aliases": [
+ "MZN",
+ "dzn",
+ "fzn",
+ "minizinc",
+ "mzn"
+ ]
+ },
+ {
+ "Name": "MLIR",
+ "Aliases": [
+ "mlir"
+ ]
+ },
+ {
+ "Name": "Modula-2",
+ "Aliases": [
+ "def",
+ "m2",
+ "mod",
+ "modula2"
+ ]
+ },
+ {
+ "Name": "MonkeyC",
+ "Aliases": [
+ "mc",
+ "monkeyc"
+ ]
+ },
+ {
+ "Name": "MorrowindScript",
+ "Aliases": [
+ "morrowind",
+ "mwscript"
+ ]
+ },
+ {
+ "Name": "Myghty",
+ "Aliases": [
+ "myghty",
+ "myt"
+ ]
+ },
+ {
+ "Name": "MySQL",
+ "Aliases": [
+ "mysql",
+ "sql"
+ ]
+ },
+ {
+ "Name": "NASM",
+ "Aliases": [
+ "ASM",
+ "asm",
+ "nasm"
+ ]
+ },
+ {
+ "Name": "Newspeak",
+ "Aliases": [
+ "newspeak",
+ "ns2"
+ ]
+ },
+ {
+ "Name": "Nginx configuration file",
+ "Aliases": [
+ "conf",
+ "nginx"
+ ]
+ },
+ {
+ "Name": "Nim",
+ "Aliases": [
+ "nim",
+ "nimrod"
+ ]
+ },
+ {
+ "Name": "Nix",
+ "Aliases": [
+ "nix",
+ "nixos"
+ ]
+ },
+ {
+ "Name": "Objective-C",
+ "Aliases": [
+ "h",
+ "m",
+ "obj-c",
+ "objc",
+ "objective-c",
+ "objectivec"
+ ]
+ },
+ {
+ "Name": "OCaml",
+ "Aliases": [
+ "ml",
+ "mli",
+ "mll",
+ "mly",
+ "ocaml"
+ ]
+ },
+ {
+ "Name": "Octave",
+ "Aliases": [
+ "m",
+ "octave"
+ ]
+ },
+ {
+ "Name": "OpenSCAD",
+ "Aliases": [
+ "openscad",
+ "scad"
+ ]
+ },
+ {
+ "Name": "Org Mode",
+ "Aliases": [
+ "org",
+ "orgmode"
+ ]
+ },
+ {
+ "Name": "PacmanConf",
+ "Aliases": [
+ "conf",
+ "pacmanconf"
+ ]
+ },
+ {
+ "Name": "Perl",
+ "Aliases": [
+ "perl",
+ "pl",
+ "pm",
+ "t"
+ ]
+ },
+ {
+ "Name": "PHP",
+ "Aliases": [
+ "inc",
+ "php",
+ "php3",
+ "php4",
+ "php5",
+ "php[345]"
+ ]
+ },
+ {
+ "Name": "PHTML",
+ "Aliases": [
+ "inc",
+ "php",
+ "php[345]",
+ "phtml"
+ ]
+ },
+ {
+ "Name": "Pig",
+ "Aliases": [
+ "pig"
+ ]
+ },
+ {
+ "Name": "PkgConfig",
+ "Aliases": [
+ "pc",
+ "pkgconfig"
+ ]
+ },
+ {
+ "Name": "PL/pgSQL",
+ "Aliases": [
+ "plpgsql"
+ ]
+ },
+ {
+ "Name": "plaintext",
+ "Aliases": [
+ "no-highlight",
+ "plain",
+ "text",
+ "txt"
+ ]
+ },
+ {
+ "Name": "Pony",
+ "Aliases": [
+ "pony"
+ ]
+ },
+ {
+ "Name": "PostgreSQL SQL dialect",
+ "Aliases": [
+ "postgres",
+ "postgresql"
+ ]
+ },
+ {
+ "Name": "PostScript",
+ "Aliases": [
+ "eps",
+ "postscr",
+ "postscript",
+ "ps"
+ ]
+ },
+ {
+ "Name": "POVRay",
+ "Aliases": [
+ "inc",
+ "pov"
+ ]
+ },
+ {
+ "Name": "PowerQuery",
+ "Aliases": [
+ "powerquery",
+ "pq"
+ ]
+ },
+ {
+ "Name": "PowerShell",
+ "Aliases": [
+ "posh",
+ "powershell",
+ "ps1",
+ "psd1",
+ "psm1"
+ ]
+ },
+ {
+ "Name": "Prolog",
+ "Aliases": [
+ "ecl",
+ "pl",
+ "pro",
+ "prolog"
+ ]
+ },
+ {
+ "Name": "PromQL",
+ "Aliases": [
+ "promql"
+ ]
+ },
+ {
+ "Name": "Protocol Buffer",
+ "Aliases": [
+ "proto",
+ "protobuf"
+ ]
+ },
+ {
+ "Name": "Puppet",
+ "Aliases": [
+ "pp",
+ "puppet"
+ ]
+ },
+ {
+ "Name": "Python",
+ "Aliases": [
+ "bazel",
+ "bzl",
+ "jy",
+ "py",
+ "py3",
+ "pyi",
+ "python",
+ "python3",
+ "pyw",
+ "sage",
+ "sc",
+ "tac"
+ ]
+ },
+ {
+ "Name": "Python 2",
+ "Aliases": [
+ "py2",
+ "python2"
+ ]
+ },
+ {
+ "Name": "QBasic",
+ "Aliases": [
+ "BAS",
+ "bas",
+ "basic",
+ "qbasic"
+ ]
+ },
+ {
+ "Name": "QML",
+ "Aliases": [
+ "qbs",
+ "qml"
+ ]
+ },
+ {
+ "Name": "R",
+ "Aliases": [
+ "R",
+ "Renviron",
+ "Rhistory",
+ "Rprofile",
+ "S",
+ "r",
+ "s",
+ "splus"
+ ]
+ },
+ {
+ "Name": "Racket",
+ "Aliases": [
+ "racket",
+ "rkt",
+ "rktd",
+ "rktl"
+ ]
+ },
+ {
+ "Name": "Ragel",
+ "Aliases": [
+ "ragel"
+ ]
+ },
+ {
+ "Name": "Raku",
+ "Aliases": [
+ "6pl",
+ "6pm",
+ "nqp",
+ "p6",
+ "p6l",
+ "p6m",
+ "perl6",
+ "pl",
+ "pl6",
+ "pm",
+ "pm6",
+ "raku",
+ "rakudoc",
+ "rakumod",
+ "rakutest",
+ "t"
+ ]
+ },
+ {
+ "Name": "react",
+ "Aliases": [
+ "jsx",
+ "react"
+ ]
+ },
+ {
+ "Name": "ReasonML",
+ "Aliases": [
+ "re",
+ "reason",
+ "reasonml",
+ "rei"
+ ]
+ },
+ {
+ "Name": "reg",
+ "Aliases": [
+ "reg",
+ "registry"
+ ]
+ },
+ {
+ "Name": "reStructuredText",
+ "Aliases": [
+ "rest",
+ "restructuredtext",
+ "rst"
+ ]
+ },
+ {
+ "Name": "Rexx",
+ "Aliases": [
+ "arexx",
+ "rex",
+ "rexx",
+ "rx"
+ ]
+ },
+ {
+ "Name": "Ruby",
+ "Aliases": [
+ "duby",
+ "gemspec",
+ "rake",
+ "rb",
+ "rbw",
+ "rbx",
+ "ruby"
+ ]
+ },
+ {
+ "Name": "Rust",
+ "Aliases": [
+ "in",
+ "rs",
+ "rust"
+ ]
+ },
+ {
+ "Name": "SAS",
+ "Aliases": [
+ "SAS",
+ "sas"
+ ]
+ },
+ {
+ "Name": "Sass",
+ "Aliases": [
+ "sass"
+ ]
+ },
+ {
+ "Name": "Scala",
+ "Aliases": [
+ "scala"
+ ]
+ },
+ {
+ "Name": "Scheme",
+ "Aliases": [
+ "scheme",
+ "scm",
+ "ss"
+ ]
+ },
+ {
+ "Name": "Scilab",
+ "Aliases": [
+ "sce",
+ "sci",
+ "scilab",
+ "tst"
+ ]
+ },
+ {
+ "Name": "SCSS",
+ "Aliases": [
+ "scss"
+ ]
+ },
+ {
+ "Name": "Smalltalk",
+ "Aliases": [
+ "smalltalk",
+ "squeak",
+ "st"
+ ]
+ },
+ {
+ "Name": "Smarty",
+ "Aliases": [
+ "smarty",
+ "tpl"
+ ]
+ },
+ {
+ "Name": "Snobol",
+ "Aliases": [
+ "snobol"
+ ]
+ },
+ {
+ "Name": "Solidity",
+ "Aliases": [
+ "sol",
+ "solidity"
+ ]
+ },
+ {
+ "Name": "SPARQL",
+ "Aliases": [
+ "rq",
+ "sparql"
+ ]
+ },
+ {
+ "Name": "SQL",
+ "Aliases": [
+ "sql"
+ ]
+ },
+ {
+ "Name": "SquidConf",
+ "Aliases": [
+ "conf",
+ "squid",
+ "squid.conf",
+ "squidconf"
+ ]
+ },
+ {
+ "Name": "Standard ML",
+ "Aliases": [
+ "fun",
+ "sig",
+ "sml"
+ ]
+ },
+ {
+ "Name": "Stylus",
+ "Aliases": [
+ "styl",
+ "stylus"
+ ]
+ },
+ {
+ "Name": "Svelte",
+ "Aliases": [
+ "svelte"
+ ]
+ },
+ {
+ "Name": "Swift",
+ "Aliases": [
+ "swift"
+ ]
+ },
+ {
+ "Name": "SYSTEMD",
+ "Aliases": [
+ "automount",
+ "device",
+ "dnssd",
+ "link",
+ "mount",
+ "netdev",
+ "network",
+ "path",
+ "scope",
+ "service",
+ "slice",
+ "socket",
+ "swap",
+ "systemd",
+ "target",
+ "timer"
+ ]
+ },
+ {
+ "Name": "systemverilog",
+ "Aliases": [
+ "sv",
+ "svh",
+ "systemverilog"
+ ]
+ },
+ {
+ "Name": "TableGen",
+ "Aliases": [
+ "tablegen",
+ "td"
+ ]
+ },
+ {
+ "Name": "TASM",
+ "Aliases": [
+ "ASM",
+ "asm",
+ "tasm"
+ ]
+ },
+ {
+ "Name": "Tcl",
+ "Aliases": [
+ "rvt",
+ "tcl"
+ ]
+ },
+ {
+ "Name": "Tcsh",
+ "Aliases": [
+ "csh",
+ "tcsh"
+ ]
+ },
+ {
+ "Name": "Termcap",
+ "Aliases": [
+ "src",
+ "termcap"
+ ]
+ },
+ {
+ "Name": "Terminfo",
+ "Aliases": [
+ "src",
+ "terminfo"
+ ]
+ },
+ {
+ "Name": "Terraform",
+ "Aliases": [
+ "terraform",
+ "tf"
+ ]
+ },
+ {
+ "Name": "TeX",
+ "Aliases": [
+ "aux",
+ "latex",
+ "tex",
+ "toc"
+ ]
+ },
+ {
+ "Name": "Thrift",
+ "Aliases": [
+ "thrift"
+ ]
+ },
+ {
+ "Name": "TOML",
+ "Aliases": [
+ "toml"
+ ]
+ },
+ {
+ "Name": "TradingView",
+ "Aliases": [
+ "tradingview",
+ "tv"
+ ]
+ },
+ {
+ "Name": "Transact-SQL",
+ "Aliases": [
+ "t-sql",
+ "tsql"
+ ]
+ },
+ {
+ "Name": "Turing",
+ "Aliases": [
+ "tu",
+ "turing"
+ ]
+ },
+ {
+ "Name": "Turtle",
+ "Aliases": [
+ "ttl",
+ "turtle"
+ ]
+ },
+ {
+ "Name": "Twig",
+ "Aliases": [
+ "twig"
+ ]
+ },
+ {
+ "Name": "TypeScript",
+ "Aliases": [
+ "ts",
+ "tsx",
+ "typescript"
+ ]
+ },
+ {
+ "Name": "TypoScript",
+ "Aliases": [
+ "ts",
+ "typoscript"
+ ]
+ },
+ {
+ "Name": "TypoScriptCssData",
+ "Aliases": [
+ "typoscriptcssdata"
+ ]
+ },
+ {
+ "Name": "TypoScriptHtmlData",
+ "Aliases": [
+ "typoscripthtmldata"
+ ]
+ },
+ {
+ "Name": "VB.net",
+ "Aliases": [
+ "bas",
+ "vb",
+ "vb.net",
+ "vbnet"
+ ]
+ },
+ {
+ "Name": "verilog",
+ "Aliases": [
+ "v",
+ "verilog"
+ ]
+ },
+ {
+ "Name": "VHDL",
+ "Aliases": [
+ "vhd",
+ "vhdl"
+ ]
+ },
+ {
+ "Name": "VimL",
+ "Aliases": [
+ "exrc",
+ "gvimrc",
+ "vim",
+ "vimrc"
+ ]
+ },
+ {
+ "Name": "vue",
+ "Aliases": [
+ "vue",
+ "vuejs"
+ ]
+ },
+ {
+ "Name": "WDTE",
+ "Aliases": [
+ "wdte"
+ ]
+ },
+ {
+ "Name": "XML",
+ "Aliases": [
+ "rss",
+ "svg",
+ "wsdl",
+ "wsf",
+ "xml",
+ "xsd",
+ "xsl",
+ "xslt"
+ ]
+ },
+ {
+ "Name": "Xorg",
+ "Aliases": [
+ "conf",
+ "xorg.conf"
+ ]
+ },
+ {
+ "Name": "YAML",
+ "Aliases": [
+ "yaml",
+ "yml"
+ ]
+ },
+ {
+ "Name": "YANG",
+ "Aliases": [
+ "yang"
+ ]
+ },
+ {
+ "Name": "Zig",
+ "Aliases": [
+ "zig"
+ ]
+ }
+ ]
+ },
+ "config": {
+ "markup": {
+ "defaultMarkdownHandler": "goldmark",
+ "highlight": {
+ "style": "monokai",
+ "codeFences": true,
+ "noClasses": true,
+ "lineNos": false,
+ "lineNumbersInTable": true,
+ "anchorLineNos": false,
+ "lineAnchors": "",
+ "lineNoStart": 1,
+ "hl_Lines": "",
+ "tabWidth": 4,
+ "guessSyntax": false
+ },
+ "tableOfContents": {
+ "startLevel": 2,
+ "endLevel": 3,
+ "ordered": false
+ },
+ "goldmark": {
+ "renderer": {
+ "hardWraps": false,
+ "xhtml": false,
+ "unsafe": false
+ },
+ "parser": {
+ "autoHeadingID": true,
+ "autoHeadingIDType": "github",
+ "attribute": {
+ "title": true,
+ "block": false
+ }
+ },
+ "extensions": {
+ "typographer": true,
+ "footnote": true,
+ "definitionList": true,
+ "table": true,
+ "strikethrough": true,
+ "linkify": true,
+ "taskList": true
+ }
+ },
+ "blackFriday": {
+ "smartypants": true,
+ "smartypantsQuotesNBSP": false,
+ "angledQuotes": false,
+ "fractions": true,
+ "hrefTargetBlank": false,
+ "nofollowLinks": false,
+ "noreferrerLinks": false,
+ "smartDashes": true,
+ "latexDashes": true,
+ "taskLists": true,
+ "plainIDAnchors": true,
+ "extensions": null,
+ "extensionsMask": null,
+ "skipHTML": false,
+ "footnoteAnchorPrefix": "",
+ "footnoteReturnLinkContents": ""
+ },
+ "asciidocExt": {
+ "backend": "html5",
+ "extensions": [],
+ "attributes": {},
+ "noHeaderOrFooter": true,
+ "safeMode": "unsafe",
+ "sectionNumbers": false,
+ "verbose": false,
+ "trace": false,
+ "failureLevel": "fatal",
+ "workingFolderCurrent": false,
+ "preserveTOC": false
+ }
+ },
+ "mergeStrategy": {
+ "build": {
+ "_merge": "none"
+ },
+ "caches": {
+ "_merge": "none"
+ },
+ "cascade": {
+ "_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,
+ "disableCSS": false,
+ "disableJS": false,
+ "disableJSON": false,
+ "disableSVG": false,
+ "disableXML": false,
+ "tdewolff": {
+ "html": {
+ "keepComments": false,
+ "keepConditionalComments": true,
+ "keepDefaultAttrVals": true,
+ "keepDocumentTags": true,
+ "keepEndTags": true,
+ "keepQuotes": false,
+ "keepWhitespace": true
+ },
+ "css": {
+ "keepCSS2": true,
+ "precision": 0
+ },
+ "js": {
+ "precision": 0,
+ "keepVarNames": false
+ },
+ "json": {
+ "precision": 0,
+ "keepNumbers": false
+ },
+ "svg": {
+ "precision": 0
+ },
+ "xml": {
+ "keepWhitespace": false
+ }
+ }
+ }
+ },
+ "media": {
+ "types": [
+ {
+ "mainType": "application",
+ "subType": "javascript",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "js",
+ "fullSuffix": ".js"
+ },
+ "type": "application/javascript",
+ "string": "application/javascript",
+ "suffixes": [
+ "js"
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "json",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "json",
+ "fullSuffix": ".json"
+ },
+ "type": "application/json",
+ "string": "application/json",
+ "suffixes": [
+ "json"
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "manifest",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "webmanifest",
+ "fullSuffix": ".webmanifest"
+ },
+ "type": "application/manifest+json",
+ "string": "application/manifest+json",
+ "suffixes": [
+ "webmanifest"
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "octet-stream",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "",
+ "fullSuffix": ""
+ },
+ "type": "application/octet-stream",
+ "string": "application/octet-stream",
+ "suffixes": [
+ ""
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "rss",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "xml",
+ "fullSuffix": ".xml"
+ },
+ "type": "application/rss+xml",
+ "string": "application/rss+xml",
+ "suffixes": [
+ "xml"
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "toml",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "toml",
+ "fullSuffix": ".toml"
+ },
+ "type": "application/toml",
+ "string": "application/toml",
+ "suffixes": [
+ "toml"
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "typescript",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "ts",
+ "fullSuffix": ".ts"
+ },
+ "type": "application/typescript",
+ "string": "application/typescript",
+ "suffixes": [
+ "ts"
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "xml",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "xml",
+ "fullSuffix": ".xml"
+ },
+ "type": "application/xml",
+ "string": "application/xml",
+ "suffixes": [
+ "xml"
+ ]
+ },
+ {
+ "mainType": "application",
+ "subType": "yaml",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "yaml",
+ "fullSuffix": ".yaml"
+ },
+ "type": "application/yaml",
+ "string": "application/yaml",
+ "suffixes": [
+ "yaml",
+ "yml"
+ ]
+ },
+ {
+ "mainType": "image",
+ "subType": "jpeg",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "jpg",
+ "fullSuffix": ".jpg"
+ },
+ "type": "image/jpeg",
+ "string": "image/jpeg",
+ "suffixes": [
+ "jpg",
+ "jpeg"
+ ]
+ },
+ {
+ "mainType": "image",
+ "subType": "png",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "png",
+ "fullSuffix": ".png"
+ },
+ "type": "image/png",
+ "string": "image/png",
+ "suffixes": [
+ "png"
+ ]
+ },
+ {
+ "mainType": "image",
+ "subType": "svg",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "svg",
+ "fullSuffix": ".svg"
+ },
+ "type": "image/svg+xml",
+ "string": "image/svg+xml",
+ "suffixes": [
+ "svg"
+ ]
+ },
+ {
+ "mainType": "image",
+ "subType": "webp",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "webp",
+ "fullSuffix": ".webp"
+ },
+ "type": "image/webp",
+ "string": "image/webp",
+ "suffixes": [
+ "webp"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "calendar",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "ics",
+ "fullSuffix": ".ics"
+ },
+ "type": "text/calendar",
+ "string": "text/calendar",
+ "suffixes": [
+ "ics"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "css",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "css",
+ "fullSuffix": ".css"
+ },
+ "type": "text/css",
+ "string": "text/css",
+ "suffixes": [
+ "css"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "csv",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "csv",
+ "fullSuffix": ".csv"
+ },
+ "type": "text/csv",
+ "string": "text/csv",
+ "suffixes": [
+ "csv"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "html",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "html",
+ "fullSuffix": ".html"
+ },
+ "type": "text/html",
+ "string": "text/html",
+ "suffixes": [
+ "html"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "jsx",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "jsx",
+ "fullSuffix": ".jsx"
+ },
+ "type": "text/jsx",
+ "string": "text/jsx",
+ "suffixes": [
+ "jsx"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "plain",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "txt",
+ "fullSuffix": ".txt"
+ },
+ "type": "text/plain",
+ "string": "text/plain",
+ "suffixes": [
+ "txt"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "tsx",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "tsx",
+ "fullSuffix": ".tsx"
+ },
+ "type": "text/tsx",
+ "string": "text/tsx",
+ "suffixes": [
+ "tsx"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "x-sass",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "sass",
+ "fullSuffix": ".sass"
+ },
+ "type": "text/x-sass",
+ "string": "text/x-sass",
+ "suffixes": [
+ "sass"
+ ]
+ },
+ {
+ "mainType": "text",
+ "subType": "x-scss",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "scss",
+ "fullSuffix": ".scss"
+ },
+ "type": "text/x-scss",
+ "string": "text/x-scss",
+ "suffixes": [
+ "scss"
+ ]
+ },
+ {
+ "mainType": "video",
+ "subType": "3gpp",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "3gpp",
+ "fullSuffix": ".3gpp"
+ },
+ "type": "video/3gpp",
+ "string": "video/3gpp",
+ "suffixes": [
+ "3gpp",
+ "3gp"
+ ]
+ },
+ {
+ "mainType": "video",
+ "subType": "mp4",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "mp4",
+ "fullSuffix": ".mp4"
+ },
+ "type": "video/mp4",
+ "string": "video/mp4",
+ "suffixes": [
+ "mp4"
+ ]
+ },
+ {
+ "mainType": "video",
+ "subType": "mpeg",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "mpg",
+ "fullSuffix": ".mpg"
+ },
+ "type": "video/mpeg",
+ "string": "video/mpeg",
+ "suffixes": [
+ "mpg",
+ "mpeg"
+ ]
+ },
+ {
+ "mainType": "video",
+ "subType": "ogg",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "ogv",
+ "fullSuffix": ".ogv"
+ },
+ "type": "video/ogg",
+ "string": "video/ogg",
+ "suffixes": [
+ "ogv"
+ ]
+ },
+ {
+ "mainType": "video",
+ "subType": "webm",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "webm",
+ "fullSuffix": ".webm"
+ },
+ "type": "video/webm",
+ "string": "video/webm",
+ "suffixes": [
+ "webm"
+ ]
+ },
+ {
+ "mainType": "video",
+ "subType": "x-msvideo",
+ "delimiter": ".",
+ "firstSuffix": {
+ "suffix": "avi",
+ "fullSuffix": ".avi"
+ },
+ "type": "video/x-msvideo",
+ "string": "video/x-msvideo",
+ "suffixes": [
+ "avi"
+ ]
+ }
+ ]
+ },
+ "output": {
+ "formats": [
+ {
+ "mediaType": "text/html",
+ "name": "HTML",
+ "path": "",
+ "baseName": "index",
+ "rel": "canonical",
+ "protocol": "",
+ "isPlainText": false,
+ "isHTML": true,
+ "noUgly": false,
+ "notAlternative": false,
+ "permalinkable": true,
+ "weight": 10
+ },
+ {
+ "mediaType": "text/html",
+ "name": "AMP",
+ "path": "amp",
+ "baseName": "index",
+ "rel": "amphtml",
+ "protocol": "",
+ "isPlainText": false,
+ "isHTML": true,
+ "noUgly": false,
+ "notAlternative": false,
+ "permalinkable": true,
+ "weight": 0
+ },
+ {
+ "mediaType": "text/css",
+ "name": "CSS",
+ "path": "",
+ "baseName": "styles",
+ "rel": "stylesheet",
+ "protocol": "",
+ "isPlainText": true,
+ "isHTML": false,
+ "noUgly": false,
+ "notAlternative": true,
+ "permalinkable": false,
+ "weight": 0
+ },
+ {
+ "mediaType": "text/csv",
+ "name": "CSV",
+ "path": "",
+ "baseName": "index",
+ "rel": "alternate",
+ "protocol": "",
+ "isPlainText": true,
+ "isHTML": false,
+ "noUgly": false,
+ "notAlternative": false,
+ "permalinkable": false,
+ "weight": 0
+ },
+ {
+ "mediaType": "text/calendar",
+ "name": "Calendar",
+ "path": "",
+ "baseName": "index",
+ "rel": "alternate",
+ "protocol": "webcal://",
+ "isPlainText": true,
+ "isHTML": false,
+ "noUgly": false,
+ "notAlternative": false,
+ "permalinkable": false,
+ "weight": 0
+ },
+ {
+ "mediaType": "application/json",
+ "name": "JSON",
+ "path": "",
+ "baseName": "index",
+ "rel": "alternate",
+ "protocol": "",
+ "isPlainText": true,
+ "isHTML": false,
+ "noUgly": false,
+ "notAlternative": false,
+ "permalinkable": false,
+ "weight": 0
+ },
+ {
+ "mediaType": "text/plain",
+ "name": "ROBOTS",
+ "path": "",
+ "baseName": "robots",
+ "rel": "alternate",
+ "protocol": "",
+ "isPlainText": true,
+ "isHTML": false,
+ "noUgly": false,
+ "notAlternative": false,
+ "permalinkable": false,
+ "weight": 0
+ },
+ {
+ "mediaType": "application/rss+xml",
+ "name": "RSS",
+ "path": "",
+ "baseName": "index",
+ "rel": "alternate",
+ "protocol": "",
+ "isPlainText": false,
+ "isHTML": false,
+ "noUgly": true,
+ "notAlternative": false,
+ "permalinkable": false,
+ "weight": 0
+ },
+ {
+ "mediaType": "application/xml",
+ "name": "Sitemap",
+ "path": "",
+ "baseName": "sitemap",
+ "rel": "sitemap",
+ "protocol": "",
+ "isPlainText": false,
+ "isHTML": false,
+ "noUgly": true,
+ "notAlternative": false,
+ "permalinkable": false,
+ "weight": 0
+ },
+ {
+ "mediaType": "application/manifest+json",
+ "name": "WebAppManifest",
+ "path": "",
+ "baseName": "manifest",
+ "rel": "manifest",
+ "protocol": "",
+ "isPlainText": true,
+ "isHTML": false,
+ "noUgly": false,
+ "notAlternative": true,
+ "permalinkable": false,
+ "weight": 0
+ }
+ ],
+ "layouts": [
+ {
+ "Example": "Single page in \"posts\" section",
+ "Kind": "page",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/single.html.html",
+ "layouts/posts/single.html",
+ "layouts/_default/single.html.html",
+ "layouts/_default/single.html"
+ ]
+ },
+ {
+ "Example": "Base template for single page in \"posts\" section",
+ "Kind": "page",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/single-baseof.html.html",
+ "layouts/posts/baseof.html.html",
+ "layouts/posts/single-baseof.html",
+ "layouts/posts/baseof.html",
+ "layouts/_default/single-baseof.html.html",
+ "layouts/_default/baseof.html.html",
+ "layouts/_default/single-baseof.html",
+ "layouts/_default/baseof.html"
+ ]
+ },
+ {
+ "Example": "Single page in \"posts\" section with layout set",
+ "Kind": "page",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/demolayout.html.html",
+ "layouts/posts/single.html.html",
+ "layouts/posts/demolayout.html",
+ "layouts/posts/single.html",
+ "layouts/_default/demolayout.html.html",
+ "layouts/_default/single.html.html",
+ "layouts/_default/demolayout.html",
+ "layouts/_default/single.html"
+ ]
+ },
+ {
+ "Example": "Base template for single page in \"posts\" section with layout set",
+ "Kind": "page",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/demolayout-baseof.html.html",
+ "layouts/posts/single-baseof.html.html",
+ "layouts/posts/baseof.html.html",
+ "layouts/posts/demolayout-baseof.html",
+ "layouts/posts/single-baseof.html",
+ "layouts/posts/baseof.html",
+ "layouts/_default/demolayout-baseof.html.html",
+ "layouts/_default/single-baseof.html.html",
+ "layouts/_default/baseof.html.html",
+ "layouts/_default/demolayout-baseof.html",
+ "layouts/_default/single-baseof.html",
+ "layouts/_default/baseof.html"
+ ]
+ },
+ {
+ "Example": "AMP single page",
+ "Kind": "page",
+ "OutputFormat": "AMP",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/single.amp.html",
+ "layouts/posts/single.html",
+ "layouts/_default/single.amp.html",
+ "layouts/_default/single.html"
+ ]
+ },
+ {
+ "Example": "AMP single page, French language",
+ "Kind": "page",
+ "OutputFormat": "AMP",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/single.fr.amp.html",
+ "layouts/posts/single.amp.html",
+ "layouts/posts/single.fr.html",
+ "layouts/posts/single.html",
+ "layouts/_default/single.fr.amp.html",
+ "layouts/_default/single.amp.html",
+ "layouts/_default/single.fr.html",
+ "layouts/_default/single.html"
+ ]
+ },
+ {
+ "Example": "Home page",
+ "Kind": "home",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/index.html.html",
+ "layouts/home.html.html",
+ "layouts/list.html.html",
+ "layouts/index.html",
+ "layouts/home.html",
+ "layouts/list.html",
+ "layouts/_default/index.html.html",
+ "layouts/_default/home.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/index.html",
+ "layouts/_default/home.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "Base template for home page",
+ "Kind": "home",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/index-baseof.html.html",
+ "layouts/home-baseof.html.html",
+ "layouts/list-baseof.html.html",
+ "layouts/baseof.html.html",
+ "layouts/index-baseof.html",
+ "layouts/home-baseof.html",
+ "layouts/list-baseof.html",
+ "layouts/baseof.html",
+ "layouts/_default/index-baseof.html.html",
+ "layouts/_default/home-baseof.html.html",
+ "layouts/_default/list-baseof.html.html",
+ "layouts/_default/baseof.html.html",
+ "layouts/_default/index-baseof.html",
+ "layouts/_default/home-baseof.html",
+ "layouts/_default/list-baseof.html",
+ "layouts/_default/baseof.html"
+ ]
+ },
+ {
+ "Example": "Home page with type set",
+ "Kind": "home",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/demotype/index.html.html",
+ "layouts/demotype/home.html.html",
+ "layouts/demotype/list.html.html",
+ "layouts/demotype/index.html",
+ "layouts/demotype/home.html",
+ "layouts/demotype/list.html",
+ "layouts/index.html.html",
+ "layouts/home.html.html",
+ "layouts/list.html.html",
+ "layouts/index.html",
+ "layouts/home.html",
+ "layouts/list.html",
+ "layouts/_default/index.html.html",
+ "layouts/_default/home.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/index.html",
+ "layouts/_default/home.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "Base template for home page with type set",
+ "Kind": "home",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/demotype/index-baseof.html.html",
+ "layouts/demotype/home-baseof.html.html",
+ "layouts/demotype/list-baseof.html.html",
+ "layouts/demotype/baseof.html.html",
+ "layouts/demotype/index-baseof.html",
+ "layouts/demotype/home-baseof.html",
+ "layouts/demotype/list-baseof.html",
+ "layouts/demotype/baseof.html",
+ "layouts/index-baseof.html.html",
+ "layouts/home-baseof.html.html",
+ "layouts/list-baseof.html.html",
+ "layouts/baseof.html.html",
+ "layouts/index-baseof.html",
+ "layouts/home-baseof.html",
+ "layouts/list-baseof.html",
+ "layouts/baseof.html",
+ "layouts/_default/index-baseof.html.html",
+ "layouts/_default/home-baseof.html.html",
+ "layouts/_default/list-baseof.html.html",
+ "layouts/_default/baseof.html.html",
+ "layouts/_default/index-baseof.html",
+ "layouts/_default/home-baseof.html",
+ "layouts/_default/list-baseof.html",
+ "layouts/_default/baseof.html"
+ ]
+ },
+ {
+ "Example": "Home page with layout set",
+ "Kind": "home",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/demolayout.html.html",
+ "layouts/index.html.html",
+ "layouts/home.html.html",
+ "layouts/list.html.html",
+ "layouts/demolayout.html",
+ "layouts/index.html",
+ "layouts/home.html",
+ "layouts/list.html",
+ "layouts/_default/demolayout.html.html",
+ "layouts/_default/index.html.html",
+ "layouts/_default/home.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/demolayout.html",
+ "layouts/_default/index.html",
+ "layouts/_default/home.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "AMP home, French language",
+ "Kind": "home",
+ "OutputFormat": "AMP",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/index.fr.amp.html",
+ "layouts/home.fr.amp.html",
+ "layouts/list.fr.amp.html",
+ "layouts/index.amp.html",
+ "layouts/home.amp.html",
+ "layouts/list.amp.html",
+ "layouts/index.fr.html",
+ "layouts/home.fr.html",
+ "layouts/list.fr.html",
+ "layouts/index.html",
+ "layouts/home.html",
+ "layouts/list.html",
+ "layouts/_default/index.fr.amp.html",
+ "layouts/_default/home.fr.amp.html",
+ "layouts/_default/list.fr.amp.html",
+ "layouts/_default/index.amp.html",
+ "layouts/_default/home.amp.html",
+ "layouts/_default/list.amp.html",
+ "layouts/_default/index.fr.html",
+ "layouts/_default/home.fr.html",
+ "layouts/_default/list.fr.html",
+ "layouts/_default/index.html",
+ "layouts/_default/home.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "JSON home",
+ "Kind": "home",
+ "OutputFormat": "JSON",
+ "Suffix": "json",
+ "Template Lookup Order": [
+ "layouts/index.json.json",
+ "layouts/home.json.json",
+ "layouts/list.json.json",
+ "layouts/index.json",
+ "layouts/home.json",
+ "layouts/list.json",
+ "layouts/_default/index.json.json",
+ "layouts/_default/home.json.json",
+ "layouts/_default/list.json.json",
+ "layouts/_default/index.json",
+ "layouts/_default/home.json",
+ "layouts/_default/list.json"
+ ]
+ },
+ {
+ "Example": "RSS home",
+ "Kind": "home",
+ "OutputFormat": "RSS",
+ "Suffix": "xml",
+ "Template Lookup Order": [
+ "layouts/index.rss.xml",
+ "layouts/home.rss.xml",
+ "layouts/rss.xml",
+ "layouts/list.rss.xml",
+ "layouts/index.xml",
+ "layouts/home.xml",
+ "layouts/list.xml",
+ "layouts/_default/index.rss.xml",
+ "layouts/_default/home.rss.xml",
+ "layouts/_default/rss.xml",
+ "layouts/_default/list.rss.xml",
+ "layouts/_default/index.xml",
+ "layouts/_default/home.xml",
+ "layouts/_default/list.xml",
+ "layouts/_internal/_default/rss.xml"
+ ]
+ },
+ {
+ "Example": "RSS section posts",
+ "Kind": "section",
+ "OutputFormat": "RSS",
+ "Suffix": "xml",
+ "Template Lookup Order": [
+ "layouts/posts/section.rss.xml",
+ "layouts/posts/rss.xml",
+ "layouts/posts/list.rss.xml",
+ "layouts/posts/section.xml",
+ "layouts/posts/list.xml",
+ "layouts/section/section.rss.xml",
+ "layouts/section/rss.xml",
+ "layouts/section/list.rss.xml",
+ "layouts/section/section.xml",
+ "layouts/section/list.xml",
+ "layouts/_default/section.rss.xml",
+ "layouts/_default/rss.xml",
+ "layouts/_default/list.rss.xml",
+ "layouts/_default/section.xml",
+ "layouts/_default/list.xml",
+ "layouts/_internal/_default/rss.xml"
+ ]
+ },
+ {
+ "Example": "Taxonomy in categories",
+ "Kind": "taxonomy",
+ "OutputFormat": "RSS",
+ "Suffix": "xml",
+ "Template Lookup Order": [
+ "layouts/categories/category.terms.rss.xml",
+ "layouts/categories/terms.rss.xml",
+ "layouts/categories/taxonomy.rss.xml",
+ "layouts/categories/rss.xml",
+ "layouts/categories/list.rss.xml",
+ "layouts/categories/category.terms.xml",
+ "layouts/categories/terms.xml",
+ "layouts/categories/taxonomy.xml",
+ "layouts/categories/list.xml",
+ "layouts/category/category.terms.rss.xml",
+ "layouts/category/terms.rss.xml",
+ "layouts/category/taxonomy.rss.xml",
+ "layouts/category/rss.xml",
+ "layouts/category/list.rss.xml",
+ "layouts/category/category.terms.xml",
+ "layouts/category/terms.xml",
+ "layouts/category/taxonomy.xml",
+ "layouts/category/list.xml",
+ "layouts/taxonomy/category.terms.rss.xml",
+ "layouts/taxonomy/terms.rss.xml",
+ "layouts/taxonomy/taxonomy.rss.xml",
+ "layouts/taxonomy/rss.xml",
+ "layouts/taxonomy/list.rss.xml",
+ "layouts/taxonomy/category.terms.xml",
+ "layouts/taxonomy/terms.xml",
+ "layouts/taxonomy/taxonomy.xml",
+ "layouts/taxonomy/list.xml",
+ "layouts/_default/category.terms.rss.xml",
+ "layouts/_default/terms.rss.xml",
+ "layouts/_default/taxonomy.rss.xml",
+ "layouts/_default/rss.xml",
+ "layouts/_default/list.rss.xml",
+ "layouts/_default/category.terms.xml",
+ "layouts/_default/terms.xml",
+ "layouts/_default/taxonomy.xml",
+ "layouts/_default/list.xml",
+ "layouts/_internal/_default/rss.xml"
+ ]
+ },
+ {
+ "Example": "Term in categories",
+ "Kind": "term",
+ "OutputFormat": "RSS",
+ "Suffix": "xml",
+ "Template Lookup Order": [
+ "layouts/categories/term.rss.xml",
+ "layouts/categories/category.rss.xml",
+ "layouts/categories/taxonomy.rss.xml",
+ "layouts/categories/rss.xml",
+ "layouts/categories/list.rss.xml",
+ "layouts/categories/term.xml",
+ "layouts/categories/category.xml",
+ "layouts/categories/taxonomy.xml",
+ "layouts/categories/list.xml",
+ "layouts/term/term.rss.xml",
+ "layouts/term/category.rss.xml",
+ "layouts/term/taxonomy.rss.xml",
+ "layouts/term/rss.xml",
+ "layouts/term/list.rss.xml",
+ "layouts/term/term.xml",
+ "layouts/term/category.xml",
+ "layouts/term/taxonomy.xml",
+ "layouts/term/list.xml",
+ "layouts/taxonomy/term.rss.xml",
+ "layouts/taxonomy/category.rss.xml",
+ "layouts/taxonomy/taxonomy.rss.xml",
+ "layouts/taxonomy/rss.xml",
+ "layouts/taxonomy/list.rss.xml",
+ "layouts/taxonomy/term.xml",
+ "layouts/taxonomy/category.xml",
+ "layouts/taxonomy/taxonomy.xml",
+ "layouts/taxonomy/list.xml",
+ "layouts/category/term.rss.xml",
+ "layouts/category/category.rss.xml",
+ "layouts/category/taxonomy.rss.xml",
+ "layouts/category/rss.xml",
+ "layouts/category/list.rss.xml",
+ "layouts/category/term.xml",
+ "layouts/category/category.xml",
+ "layouts/category/taxonomy.xml",
+ "layouts/category/list.xml",
+ "layouts/_default/term.rss.xml",
+ "layouts/_default/category.rss.xml",
+ "layouts/_default/taxonomy.rss.xml",
+ "layouts/_default/rss.xml",
+ "layouts/_default/list.rss.xml",
+ "layouts/_default/term.xml",
+ "layouts/_default/category.xml",
+ "layouts/_default/taxonomy.xml",
+ "layouts/_default/list.xml",
+ "layouts/_internal/_default/rss.xml"
+ ]
+ },
+ {
+ "Example": "Section list for \"posts\" section",
+ "Kind": "section",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/posts.html.html",
+ "layouts/posts/section.html.html",
+ "layouts/posts/list.html.html",
+ "layouts/posts/posts.html",
+ "layouts/posts/section.html",
+ "layouts/posts/list.html",
+ "layouts/section/posts.html.html",
+ "layouts/section/section.html.html",
+ "layouts/section/list.html.html",
+ "layouts/section/posts.html",
+ "layouts/section/section.html",
+ "layouts/section/list.html",
+ "layouts/_default/posts.html.html",
+ "layouts/_default/section.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/posts.html",
+ "layouts/_default/section.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "Section list for \"posts\" section with type set to \"blog\"",
+ "Kind": "section",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/blog/posts.html.html",
+ "layouts/blog/section.html.html",
+ "layouts/blog/list.html.html",
+ "layouts/blog/posts.html",
+ "layouts/blog/section.html",
+ "layouts/blog/list.html",
+ "layouts/posts/posts.html.html",
+ "layouts/posts/section.html.html",
+ "layouts/posts/list.html.html",
+ "layouts/posts/posts.html",
+ "layouts/posts/section.html",
+ "layouts/posts/list.html",
+ "layouts/section/posts.html.html",
+ "layouts/section/section.html.html",
+ "layouts/section/list.html.html",
+ "layouts/section/posts.html",
+ "layouts/section/section.html",
+ "layouts/section/list.html",
+ "layouts/_default/posts.html.html",
+ "layouts/_default/section.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/posts.html",
+ "layouts/_default/section.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "Section list for \"posts\" section with layout set to \"demoLayout\"",
+ "Kind": "section",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/posts/demolayout.html.html",
+ "layouts/posts/posts.html.html",
+ "layouts/posts/section.html.html",
+ "layouts/posts/list.html.html",
+ "layouts/posts/demolayout.html",
+ "layouts/posts/posts.html",
+ "layouts/posts/section.html",
+ "layouts/posts/list.html",
+ "layouts/section/demolayout.html.html",
+ "layouts/section/posts.html.html",
+ "layouts/section/section.html.html",
+ "layouts/section/list.html.html",
+ "layouts/section/demolayout.html",
+ "layouts/section/posts.html",
+ "layouts/section/section.html",
+ "layouts/section/list.html",
+ "layouts/_default/demolayout.html.html",
+ "layouts/_default/posts.html.html",
+ "layouts/_default/section.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/demolayout.html",
+ "layouts/_default/posts.html",
+ "layouts/_default/section.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "Taxonomy list in categories",
+ "Kind": "taxonomy",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/categories/category.terms.html.html",
+ "layouts/categories/terms.html.html",
+ "layouts/categories/taxonomy.html.html",
+ "layouts/categories/list.html.html",
+ "layouts/categories/category.terms.html",
+ "layouts/categories/terms.html",
+ "layouts/categories/taxonomy.html",
+ "layouts/categories/list.html",
+ "layouts/category/category.terms.html.html",
+ "layouts/category/terms.html.html",
+ "layouts/category/taxonomy.html.html",
+ "layouts/category/list.html.html",
+ "layouts/category/category.terms.html",
+ "layouts/category/terms.html",
+ "layouts/category/taxonomy.html",
+ "layouts/category/list.html",
+ "layouts/taxonomy/category.terms.html.html",
+ "layouts/taxonomy/terms.html.html",
+ "layouts/taxonomy/taxonomy.html.html",
+ "layouts/taxonomy/list.html.html",
+ "layouts/taxonomy/category.terms.html",
+ "layouts/taxonomy/terms.html",
+ "layouts/taxonomy/taxonomy.html",
+ "layouts/taxonomy/list.html",
+ "layouts/_default/category.terms.html.html",
+ "layouts/_default/terms.html.html",
+ "layouts/_default/taxonomy.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/category.terms.html",
+ "layouts/_default/terms.html",
+ "layouts/_default/taxonomy.html",
+ "layouts/_default/list.html"
+ ]
+ },
+ {
+ "Example": "Taxonomy term in categories",
+ "Kind": "term",
+ "OutputFormat": "HTML",
+ "Suffix": "html",
+ "Template Lookup Order": [
+ "layouts/categories/term.html.html",
+ "layouts/categories/category.html.html",
+ "layouts/categories/taxonomy.html.html",
+ "layouts/categories/list.html.html",
+ "layouts/categories/term.html",
+ "layouts/categories/category.html",
+ "layouts/categories/taxonomy.html",
+ "layouts/categories/list.html",
+ "layouts/term/term.html.html",
+ "layouts/term/category.html.html",
+ "layouts/term/taxonomy.html.html",
+ "layouts/term/list.html.html",
+ "layouts/term/term.html",
+ "layouts/term/category.html",
+ "layouts/term/taxonomy.html",
+ "layouts/term/list.html",
+ "layouts/taxonomy/term.html.html",
+ "layouts/taxonomy/category.html.html",
+ "layouts/taxonomy/taxonomy.html.html",
+ "layouts/taxonomy/list.html.html",
+ "layouts/taxonomy/term.html",
+ "layouts/taxonomy/category.html",
+ "layouts/taxonomy/taxonomy.html",
+ "layouts/taxonomy/list.html",
+ "layouts/category/term.html.html",
+ "layouts/category/category.html.html",
+ "layouts/category/taxonomy.html.html",
+ "layouts/category/list.html.html",
+ "layouts/category/term.html",
+ "layouts/category/category.html",
+ "layouts/category/taxonomy.html",
+ "layouts/category/list.html",
+ "layouts/_default/term.html.html",
+ "layouts/_default/category.html.html",
+ "layouts/_default/taxonomy.html.html",
+ "layouts/_default/list.html.html",
+ "layouts/_default/term.html",
+ "layouts/_default/category.html",
+ "layouts/_default/taxonomy.html",
+ "layouts/_default/list.html"
+ ]
+ }
+ ]
+ },
+ "tpl": {
+ "funcs": {
+ "cast": {
+ "ToFloat": {
+ "Description": "ToFloat converts the given value to a float.",
+ "Args": [
+ "v"
+ ],
+ "Aliases": [
+ "float"
+ ],
+ "Examples": [
+ [
+ "{{ \"1234\" | float | printf \"%T\" }}",
+ "float64"
+ ]
+ ]
+ },
+ "ToInt": {
+ "Description": "ToInt converts the given value to an int.",
+ "Args": [
+ "v"
+ ],
+ "Aliases": [
+ "int"
+ ],
+ "Examples": [
+ [
+ "{{ \"1234\" | int | printf \"%T\" }}",
+ "int"
+ ]
+ ]
+ },
+ "ToString": {
+ "Description": "ToString converts the given value to a string.",
+ "Args": [
+ "v"
+ ],
+ "Aliases": [
+ "string"
+ ],
+ "Examples": [
+ [
+ "{{ 1234 | string | printf \"%T\" }}",
+ "string"
+ ]
+ ]
+ }
+ },
+ "compare": {
+ "Conditional": {
+ "Description": "Conditional can be used as a ternary operator.\nIt returns a if condition, else b.",
+ "Args": [
+ "condition",
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "cond"
+ ],
+ "Examples": [
+ [
+ "{{ cond (eq (add 2 2) 4) \"2+2 is 4\" \"what?\" | safeHTML }}",
+ "2+2 is 4"
+ ]
+ ]
+ },
+ "Default": {
+ "Description": "Default checks whether a given value is set and returns a default value if it\nis not. \"Set\" in this context means non-zero for numeric types and times;\nnon-zero length for strings, arrays, slices, and maps;\nany boolean or struct value; or non-nil for any other types.",
+ "Args": [
+ "dflt",
+ "given"
+ ],
+ "Aliases": [
+ "default"
+ ],
+ "Examples": [
+ [
+ "{{ \"Hugo Rocks!\" | default \"Hugo Rules!\" }}",
+ "Hugo Rocks!"
+ ],
+ [
+ "{{ \"\" | default \"Hugo Rules!\" }}",
+ "Hugo Rules!"
+ ]
+ ]
+ },
+ "Eq": {
+ "Description": "Eq returns the boolean truth of arg1 == arg2 || arg1 == arg3 || arg1 == arg4.",
+ "Args": [
+ "first",
+ "others"
+ ],
+ "Aliases": [
+ "eq"
+ ],
+ "Examples": [
+ [
+ "{{ if eq .Section \"blog\" }}current{{ end }}",
+ "current"
+ ]
+ ]
+ },
+ "Ge": {
+ "Description": "Ge returns the boolean truth of arg1 \u003e= arg2 \u0026\u0026 arg1 \u003e= arg3 \u0026\u0026 arg1 \u003e= arg4.",
+ "Args": [
+ "first",
+ "others"
+ ],
+ "Aliases": [
+ "ge"
+ ],
+ "Examples": [
+ [
+ "{{ if ge .Hugo.Version \"0.36\" }}Reasonable new Hugo version!{{ end }}",
+ "Reasonable new Hugo version!"
+ ]
+ ]
+ },
+ "Gt": {
+ "Description": "Gt returns the boolean truth of arg1 \u003e arg2 \u0026\u0026 arg1 \u003e arg3 \u0026\u0026 arg1 \u003e arg4.",
+ "Args": [
+ "first",
+ "others"
+ ],
+ "Aliases": [
+ "gt"
+ ],
+ "Examples": []
+ },
+ "Le": {
+ "Description": "Le returns the boolean truth of arg1 \u003c= arg2 \u0026\u0026 arg1 \u003c= arg3 \u0026\u0026 arg1 \u003c= arg4.",
+ "Args": [
+ "first",
+ "others"
+ ],
+ "Aliases": [
+ "le"
+ ],
+ "Examples": []
+ },
+ "Lt": {
+ "Description": "Lt returns the boolean truth of arg1 \u003c arg2 \u0026\u0026 arg1 \u003c arg3 \u0026\u0026 arg1 \u003c arg4.",
+ "Args": [
+ "first",
+ "others"
+ ],
+ "Aliases": [
+ "lt"
+ ],
+ "Examples": []
+ },
+ "Ne": {
+ "Description": "Ne returns the boolean truth of arg1 != arg2 \u0026\u0026 arg1 != arg3 \u0026\u0026 arg1 != arg4.",
+ "Args": [
+ "first",
+ "others"
+ ],
+ "Aliases": [
+ "ne"
+ ],
+ "Examples": []
+ }
+ },
+ "collections": {
+ "After": {
+ "Description": "After returns all the items after the first N in a rangeable list.",
+ "Args": [
+ "index",
+ "seq"
+ ],
+ "Aliases": [
+ "after"
+ ],
+ "Examples": []
+ },
+ "Append": {
+ "Description": "Append appends the arguments up to the last one to the slice in the last argument.\nThis construct allows template constructs like this:\n {{ $pages = $pages | append $p2 $p1 }}\nNote that with 2 arguments where both are slices of the same type,\nthe first slice will be appended to the second:\n {{ $pages = $pages | append .Site.RegularPages }}",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "append"
+ ],
+ "Examples": []
+ },
+ "Apply": {
+ "Description": "Apply takes a map, array, or slice and returns a new slice with the function fname applied over it.",
+ "Args": [
+ "seq",
+ "fname",
+ "args"
+ ],
+ "Aliases": [
+ "apply"
+ ],
+ "Examples": []
+ },
+ "Complement": {
+ "Description": "Complement gives the elements in the last element of seqs that are not in\nany of the others.\nAll elements of seqs must be slices or arrays of comparable types.\n\nThe reasoning behind this rather clumsy API is so we can do this in the templates:\n {{ $c := .Pages | complement $last4 }}",
+ "Args": [
+ "seqs"
+ ],
+ "Aliases": [
+ "complement"
+ ],
+ "Examples": [
+ [
+ "{{ slice \"a\" \"b\" \"c\" \"d\" \"e\" \"f\" | complement (slice \"b\" \"c\") (slice \"d\" \"e\") }}",
+ "[a f]"
+ ]
+ ]
+ },
+ "Delimit": {
+ "Description": "Delimit takes a given sequence and returns a delimited HTML string.\nIf last is passed to the function, it will be used as the final delimiter.",
+ "Args": [
+ "seq",
+ "delimiter",
+ "last"
+ ],
+ "Aliases": [
+ "delimit"
+ ],
+ "Examples": [
+ [
+ "{{ delimit (slice \"A\" \"B\" \"C\") \", \" \" and \" }}",
+ "A, B and C"
+ ]
+ ]
+ },
+ "Dictionary": {
+ "Description": "Dictionary creates a map[string]interface{} from the given parameters by\nwalking the parameters and treating them as key-value pairs. The number\nof parameters must be even.\nThe keys can be string slices, which will create the needed nested structure.",
+ "Args": [
+ "values"
+ ],
+ "Aliases": [
+ "dict"
+ ],
+ "Examples": []
+ },
+ "EchoParam": {
+ "Description": "EchoParam returns a given value if it is set; otherwise, it returns an\nempty string.",
+ "Args": [
+ "a",
+ "key"
+ ],
+ "Aliases": [
+ "echoParam"
+ ],
+ "Examples": [
+ [
+ "{{ echoParam .Params \"langCode\" }}",
+ "en"
+ ]
+ ]
+ },
+ "First": {
+ "Description": "First returns the first N items in a rangeable list.",
+ "Args": [
+ "limit",
+ "seq"
+ ],
+ "Aliases": [
+ "first"
+ ],
+ "Examples": []
+ },
+ "Group": {
+ "Description": "Group groups a set of elements by the given key.\nThis is currently only supported for Pages.",
+ "Args": [
+ "key",
+ "items"
+ ],
+ "Aliases": [
+ "group"
+ ],
+ "Examples": []
+ },
+ "In": {
+ "Description": "In returns whether v is in the set l. l may be an array or slice.",
+ "Args": [
+ "l",
+ "v"
+ ],
+ "Aliases": [
+ "in"
+ ],
+ "Examples": [
+ [
+ "{{ if in \"this string contains a substring\" \"substring\" }}Substring found!{{ end }}",
+ "Substring found!"
+ ]
+ ]
+ },
+ "Index": {
+ "Description": "Index returns the result of indexing its first argument by the following\narguments. Thus \"index x 1 2 3\" is, in Go syntax, x[1][2][3]. Each\nindexed item must be a map, slice, or array.\n\nCopied from Go stdlib src/text/template/funcs.go.\n\nWe deviate from the stdlib due to https://github.com/golang/go/issues/14751.\n\nTODO(moorereason): merge upstream changes.",
+ "Args": [
+ "item",
+ "args"
+ ],
+ "Aliases": [
+ "index"
+ ],
+ "Examples": []
+ },
+ "Intersect": {
+ "Description": "Intersect returns the common elements in the given sets, l1 and l2. l1 and\nl2 must be of the same type and may be either arrays or slices.",
+ "Args": [
+ "l1",
+ "l2"
+ ],
+ "Aliases": [
+ "intersect"
+ ],
+ "Examples": []
+ },
+ "IsSet": {
+ "Description": "IsSet returns whether a given array, channel, slice, or map has a key\ndefined.",
+ "Args": [
+ "a",
+ "key"
+ ],
+ "Aliases": [
+ "isSet",
+ "isset"
+ ],
+ "Examples": []
+ },
+ "KeyVals": {
+ "Description": "KeyVals creates a key and values wrapper.",
+ "Args": [
+ "key",
+ "vals"
+ ],
+ "Aliases": [
+ "keyVals"
+ ],
+ "Examples": [
+ [
+ "{{ keyVals \"key\" \"a\" \"b\" }}",
+ "key: [a b]"
+ ]
+ ]
+ },
+ "Last": {
+ "Description": "Last returns the last N items in a rangeable list.",
+ "Args": [
+ "limit",
+ "seq"
+ ],
+ "Aliases": [
+ "last"
+ ],
+ "Examples": []
+ },
+ "Merge": {
+ "Description": "Merge creates a copy of the final parameter and merges the preceding\nparameters into it in reverse order.\nCurrently only maps are supported. Key handling is case insensitive.",
+ "Args": [
+ "params"
+ ],
+ "Aliases": [
+ "merge"
+ ],
+ "Examples": [
+ [
+ "{{ dict \"title\" \"Hugo Rocks!\" | collections.Merge (dict \"title\" \"Default Title\" \"description\" \"Yes, Hugo Rocks!\") | sort }}",
+ "[Yes, Hugo Rocks! Hugo Rocks!]"
+ ],
+ [
+ "{{ merge (dict \"title\" \"Default Title\" \"description\" \"Yes, Hugo Rocks!\") (dict \"title\" \"Hugo Rocks!\") | sort }}",
+ "[Yes, Hugo Rocks! Hugo Rocks!]"
+ ],
+ [
+ "{{ merge (dict \"title\" \"Default Title\" \"description\" \"Yes, Hugo Rocks!\") (dict \"title\" \"Hugo Rocks!\") (dict \"extra\" \"For reals!\") | sort }}",
+ "[Yes, Hugo Rocks! For reals! Hugo Rocks!]"
+ ]
+ ]
+ },
+ "NewScratch": {
+ "Description": "NewScratch creates a new Scratch which can be used to store values in a\nthread safe way.",
+ "Args": null,
+ "Aliases": [
+ "newScratch"
+ ],
+ "Examples": [
+ [
+ "{{ $scratch := newScratch }}{{ $scratch.Add \"b\" 2 }}{{ $scratch.Add \"b\" 2 }}{{ $scratch.Get \"b\" }}",
+ "4"
+ ]
+ ]
+ },
+ "Querify": {
+ "Description": "Querify encodes the given parameters in URL-encoded form (\"bar=baz\u0026foo=quux\") sorted by key.",
+ "Args": [
+ "params"
+ ],
+ "Aliases": [
+ "querify"
+ ],
+ "Examples": [
+ [
+ "{{ (querify \"foo\" 1 \"bar\" 2 \"baz\" \"with spaces\" \"qux\" \"this\u0026that=those\") | safeHTML }}",
+ "bar=2\u0026baz=with+spaces\u0026foo=1\u0026qux=this%26that%3Dthose"
+ ],
+ [
+ "\u003ca href=\"https://www.google.com?{{ (querify \"q\" \"test\" \"page\" 3) | safeURL }}\"\u003eSearch\u003c/a\u003e",
+ "\u003ca href=\"https://www.google.com?page=3\u0026amp;q=test\"\u003eSearch\u003c/a\u003e"
+ ],
+ [
+ "{{ slice \"foo\" 1 \"bar\" 2 | querify | safeHTML }}",
+ "bar=2\u0026foo=1"
+ ]
+ ]
+ },
+ "Reverse": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Seq": {
+ "Description": "Seq creates a sequence of integers. It's named and used as GNU's seq.\n\nExamples:\n 3 =\u003e 1, 2, 3\n 1 2 4 =\u003e 1, 3\n -3 =\u003e -1, -2, -3\n 1 4 =\u003e 1, 2, 3, 4\n 1 -2 =\u003e 1, 0, -1, -2",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "seq"
+ ],
+ "Examples": [
+ [
+ "{{ seq 3 }}",
+ "[1 2 3]"
+ ]
+ ]
+ },
+ "Shuffle": {
+ "Description": "Shuffle returns the given rangeable list in a randomised order.",
+ "Args": [
+ "seq"
+ ],
+ "Aliases": [
+ "shuffle"
+ ],
+ "Examples": []
+ },
+ "Slice": {
+ "Description": "Slice returns a slice of all passed arguments.",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "slice"
+ ],
+ "Examples": [
+ [
+ "{{ slice \"B\" \"C\" \"A\" | sort }}",
+ "[A B C]"
+ ]
+ ]
+ },
+ "Sort": {
+ "Description": "Sort returns a sorted sequence.",
+ "Args": [
+ "seq",
+ "args"
+ ],
+ "Aliases": [
+ "sort"
+ ],
+ "Examples": []
+ },
+ "SymDiff": {
+ "Description": "SymDiff returns the symmetric difference of s1 and s2.\nArguments must be either a slice or an array of comparable types.",
+ "Args": [
+ "s2",
+ "s1"
+ ],
+ "Aliases": [
+ "symdiff"
+ ],
+ "Examples": [
+ [
+ "{{ slice 1 2 3 | symdiff (slice 3 4) }}",
+ "[1 2 4]"
+ ]
+ ]
+ },
+ "Union": {
+ "Description": "Union returns the union of the given sets, l1 and l2. l1 and\nl2 must be of the same type and may be either arrays or slices.\nIf l1 and l2 aren't of the same type then l1 will be returned.\nIf either l1 or l2 is nil then the non-nil list will be returned.",
+ "Args": [
+ "l1",
+ "l2"
+ ],
+ "Aliases": [
+ "union"
+ ],
+ "Examples": [
+ [
+ "{{ union (slice 1 2 3) (slice 3 4 5) }}",
+ "[1 2 3 4 5]"
+ ]
+ ]
+ },
+ "Uniq": {
+ "Description": "Uniq takes in a slice or array and returns a slice with subsequent\nduplicate elements removed.",
+ "Args": [
+ "seq"
+ ],
+ "Aliases": [
+ "uniq"
+ ],
+ "Examples": [
+ [
+ "{{ slice 1 2 3 2 | uniq }}",
+ "[1 2 3]"
+ ]
+ ]
+ },
+ "Where": {
+ "Description": "Where returns a filtered subset of a given data type.",
+ "Args": [
+ "seq",
+ "key",
+ "args"
+ ],
+ "Aliases": [
+ "where"
+ ],
+ "Examples": []
+ }
+ },
+ "crypto": {
+ "HMAC": {
+ "Description": "HMAC returns a cryptographic hash that uses a key to sign a message.",
+ "Args": [
+ "h",
+ "k",
+ "m"
+ ],
+ "Aliases": [
+ "hmac"
+ ],
+ "Examples": [
+ [
+ "{{ hmac \"sha256\" \"Secret key\" \"Hello world, gophers!\" }}",
+ "b6d11b6c53830b9d87036272ca9fe9d19306b8f9d8aa07b15da27d89e6e34f40"
+ ]
+ ]
+ },
+ "MD5": {
+ "Description": "MD5 hashes the given input and returns its MD5 checksum.",
+ "Args": [
+ "in"
+ ],
+ "Aliases": [
+ "md5"
+ ],
+ "Examples": [
+ [
+ "{{ md5 \"Hello world, gophers!\" }}",
+ "b3029f756f98f79e7f1b7f1d1f0dd53b"
+ ],
+ [
+ "{{ crypto.MD5 \"Hello world, gophers!\" }}",
+ "b3029f756f98f79e7f1b7f1d1f0dd53b"
+ ]
+ ]
+ },
+ "SHA1": {
+ "Description": "SHA1 hashes the given input and returns its SHA1 checksum.",
+ "Args": [
+ "in"
+ ],
+ "Aliases": [
+ "sha1"
+ ],
+ "Examples": [
+ [
+ "{{ sha1 \"Hello world, gophers!\" }}",
+ "c8b5b0e33d408246e30f53e32b8f7627a7a649d4"
+ ]
+ ]
+ },
+ "SHA256": {
+ "Description": "SHA256 hashes the given input and returns its SHA256 checksum.",
+ "Args": [
+ "in"
+ ],
+ "Aliases": [
+ "sha256"
+ ],
+ "Examples": [
+ [
+ "{{ sha256 \"Hello world, gophers!\" }}",
+ "6ec43b78da9669f50e4e422575c54bf87536954ccd58280219c393f2ce352b46"
+ ]
+ ]
+ }
+ },
+ "data": {
+ "GetCSV": {
+ "Description": "GetCSV expects a data separator and one or n-parts of a URL to a resource which\ncan either be a local or a remote one.\nThe data separator can be a comma, semi-colon, pipe, etc, but only one character.\nIf you provide multiple parts for the URL they will be joined together to the final URL.\nGetCSV returns nil or a slice slice to use in a short code.",
+ "Args": [
+ "sep",
+ "args"
+ ],
+ "Aliases": [
+ "getCSV"
+ ],
+ "Examples": []
+ },
+ "GetJSON": {
+ "Description": "GetJSON expects one or n-parts of a URL to a resource which can either be a local or a remote one.\nIf you provide multiple parts they will be joined together to the final URL.\nGetJSON returns nil or parsed JSON to use in a short code.",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "getJSON"
+ ],
+ "Examples": []
+ }
+ },
+ "debug": {
+ "Dump": {
+ "Description": "Dump returns a object dump of val as a string.\nNote that not every value passed to Dump will print so nicely, but\nwe'll improve on that. We recommend using the \"go\" Chroma lexer to format the output\nnicely.\nAlso note that the output from Dump may change from Hugo version to the next,\nso don't depend on a specific output.",
+ "Args": [
+ "val"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{- $m := newScratch -}}\n{{- $m.Set \"Hugo\" \"Rocks!\" -}}\n{{- $m.Values | debug.Dump | safeHTML -}}",
+ "map[string]interface {}{\n \"Hugo\": \"Rocks!\",\n}"
+ ]
+ ]
+ }
+ },
+ "encoding": {
+ "Base64Decode": {
+ "Description": "Base64Decode returns the base64 decoding of the given content.",
+ "Args": [
+ "content"
+ ],
+ "Aliases": [
+ "base64Decode"
+ ],
+ "Examples": [
+ [
+ "{{ \"SGVsbG8gd29ybGQ=\" | base64Decode }}",
+ "Hello world"
+ ],
+ [
+ "{{ 42 | base64Encode | base64Decode }}",
+ "42"
+ ]
+ ]
+ },
+ "Base64Encode": {
+ "Description": "Base64Encode returns the base64 encoding of the given content.",
+ "Args": [
+ "content"
+ ],
+ "Aliases": [
+ "base64Encode"
+ ],
+ "Examples": [
+ [
+ "{{ \"Hello world\" | base64Encode }}",
+ "SGVsbG8gd29ybGQ="
+ ]
+ ]
+ },
+ "Jsonify": {
+ "Description": "Jsonify encodes a given object to JSON. To pretty print the JSON, pass a map\nor dictionary of options as the first argument. Supported options are\n\"prefix\" and \"indent\". Each JSON element in the output will begin on a new\nline beginning with prefix followed by one or more copies of indent according\nto the indentation nesting.",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "jsonify"
+ ],
+ "Examples": [
+ [
+ "{{ (slice \"A\" \"B\" \"C\") | jsonify }}",
+ "[\"A\",\"B\",\"C\"]"
+ ],
+ [
+ "{{ (slice \"A\" \"B\" \"C\") | jsonify (dict \"indent\" \" \") }}",
+ "[\n \"A\",\n \"B\",\n \"C\"\n]"
+ ]
+ ]
+ }
+ },
+ "fmt": {
+ "Errorf": {
+ "Description": "Errorf formats according to a format specifier and logs an ERROR.\nIt returns an empty string.",
+ "Args": [
+ "format",
+ "a"
+ ],
+ "Aliases": [
+ "errorf"
+ ],
+ "Examples": [
+ [
+ "{{ errorf \"%s.\" \"failed\" }}",
+ ""
+ ]
+ ]
+ },
+ "Erroridf": {
+ "Description": "Erroridf formats according to a format specifier and logs an ERROR and\nan information text that the error with the given ID can be suppressed in config.\nIt returns an empty string.",
+ "Args": [
+ "id",
+ "format",
+ "a"
+ ],
+ "Aliases": [
+ "erroridf"
+ ],
+ "Examples": [
+ [
+ "{{ erroridf \"my-err-id\" \"%s.\" \"failed\" }}",
+ ""
+ ]
+ ]
+ },
+ "Print": {
+ "Description": "Print returns string representation of the passed arguments.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "print"
+ ],
+ "Examples": [
+ [
+ "{{ print \"works!\" }}",
+ "works!"
+ ]
+ ]
+ },
+ "Printf": {
+ "Description": "Printf returns a formatted string representation of the passed arguments.",
+ "Args": [
+ "format",
+ "a"
+ ],
+ "Aliases": [
+ "printf"
+ ],
+ "Examples": [
+ [
+ "{{ printf \"%s!\" \"works\" }}",
+ "works!"
+ ]
+ ]
+ },
+ "Println": {
+ "Description": "Println returns string representation of the passed arguments ending with a newline.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "println"
+ ],
+ "Examples": [
+ [
+ "{{ println \"works!\" }}",
+ "works!\n"
+ ]
+ ]
+ },
+ "Warnf": {
+ "Description": "Warnf formats according to a format specifier and logs a WARNING.\nIt returns an empty string.",
+ "Args": [
+ "format",
+ "a"
+ ],
+ "Aliases": [
+ "warnf"
+ ],
+ "Examples": [
+ [
+ "{{ warnf \"%s.\" \"warning\" }}",
+ ""
+ ]
+ ]
+ }
+ },
+ "hugo": {
+ "Generator": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "IsExtended": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "IsProduction": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Version": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ }
+ },
+ "images": {
+ "Brightness": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "ColorBalance": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Colorize": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Config": {
+ "Description": "Config returns the image.Config for the specified path relative to the\nworking directory.",
+ "Args": [
+ "path"
+ ],
+ "Aliases": [
+ "imageConfig"
+ ],
+ "Examples": []
+ },
+ "Contrast": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Filter": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Gamma": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "GaussianBlur": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Grayscale": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Hue": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Invert": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Overlay": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Pixelate": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Saturation": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Sepia": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Sigmoid": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "UnsharpMask": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ }
+ },
+ "inflect": {
+ "Humanize": {
+ "Description": "Humanize returns the humanized form of a single parameter.\n\nIf the parameter is either an integer or a string containing an integer\nvalue, the behavior is to add the appropriate ordinal.\n\n Example: \"my-first-post\" -\u003e \"My first post\"\n Example: \"103\" -\u003e \"103rd\"\n Example: 52 -\u003e \"52nd\"",
+ "Args": [
+ "in"
+ ],
+ "Aliases": [
+ "humanize"
+ ],
+ "Examples": [
+ [
+ "{{ humanize \"my-first-post\" }}",
+ "My first post"
+ ],
+ [
+ "{{ humanize \"myCamelPost\" }}",
+ "My camel post"
+ ],
+ [
+ "{{ humanize \"52\" }}",
+ "52nd"
+ ],
+ [
+ "{{ humanize 103 }}",
+ "103rd"
+ ]
+ ]
+ },
+ "Pluralize": {
+ "Description": "Pluralize returns the plural form of a single word.",
+ "Args": [
+ "in"
+ ],
+ "Aliases": [
+ "pluralize"
+ ],
+ "Examples": [
+ [
+ "{{ \"cat\" | pluralize }}",
+ "cats"
+ ]
+ ]
+ },
+ "Singularize": {
+ "Description": "Singularize returns the singular form of a single word.",
+ "Args": [
+ "in"
+ ],
+ "Aliases": [
+ "singularize"
+ ],
+ "Examples": [
+ [
+ "{{ \"cats\" | singularize }}",
+ "cat"
+ ]
+ ]
+ }
+ },
+ "js": {
+ "Build": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ }
+ },
+ "lang": {
+ "FormatAccounting": {
+ "Description": "FormatAccounting returns the currency reprecentation of number for the given currency and precision\nfor the current language in accounting notation.",
+ "Args": [
+ "precision",
+ "currency",
+ "number"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ 512.5032 | lang.FormatAccounting 2 \"NOK\" }}",
+ "NOK512.50"
+ ]
+ ]
+ },
+ "FormatCurrency": {
+ "Description": "FormatCurrency returns the currency reprecentation of number for the given currency and precision\nfor the current language.",
+ "Args": [
+ "precision",
+ "currency",
+ "number"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ 512.5032 | lang.FormatCurrency 2 \"USD\" }}",
+ "$512.50"
+ ]
+ ]
+ },
+ "FormatNumber": {
+ "Description": "FormatNumber formats number with the given precision for the current language.",
+ "Args": [
+ "precision",
+ "number"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ 512.5032 | lang.FormatNumber 2 }}",
+ "512.50"
+ ]
+ ]
+ },
+ "FormatNumberCustom": {
+ "Description": "FormatNumberCustom formats a number with the given precision using the\nnegative, decimal, and grouping options. The `options`\nparameter is a string consisting of `\u003cnegative\u003e \u003cdecimal\u003e \u003cgrouping\u003e`. The\ndefault `options` value is `- . ,`.\n\nNote that numbers are rounded up at 5 or greater.\nSo, with precision set to 0, 1.5 becomes `2`, and 1.4 becomes `1`.\n\nFor a simpler function that adapts to the current language, see FormatNumberCustom.",
+ "Args": [
+ "precision",
+ "number",
+ "options"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ lang.FormatNumberCustom 2 12345.6789 }}",
+ "12,345.68"
+ ],
+ [
+ "{{ lang.FormatNumberCustom 2 12345.6789 \"- , .\" }}",
+ "12.345,68"
+ ],
+ [
+ "{{ lang.FormatNumberCustom 6 -12345.6789 \"- .\" }}",
+ "-12345.678900"
+ ],
+ [
+ "{{ lang.FormatNumberCustom 0 -12345.6789 \"- . ,\" }}",
+ "-12,346"
+ ],
+ [
+ "{{ -98765.4321 | lang.FormatNumberCustom 2 }}",
+ "-98,765.43"
+ ]
+ ]
+ },
+ "FormatPercent": {
++ "Description": "FormatPercent formats number with the given precision for the current language.\nNote that the number is assumed to be a percentage.",
+ "Args": [
+ "precision",
+ "number"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ 512.5032 | lang.FormatPercent 2 }}",
+ "512.50%"
+ ]
+ ]
+ },
+ "Merge": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "NumFmt": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Translate": {
+ "Description": "Translate returns a translated string for id.",
+ "Args": [
+ "id",
+ "args"
+ ],
+ "Aliases": [
+ "i18n",
+ "T"
+ ],
+ "Examples": []
+ }
+ },
+ "math": {
+ "Add": {
+ "Description": "Add adds two numbers.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "add"
+ ],
+ "Examples": [
+ [
+ "{{add 1 2}}",
+ "3"
+ ]
+ ]
+ },
+ "Ceil": {
+ "Description": "Ceil returns the least integer value greater than or equal to x.",
+ "Args": [
+ "x"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{math.Ceil 2.1}}",
+ "3"
+ ]
+ ]
+ },
+ "Div": {
+ "Description": "Div divides two numbers.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "div"
+ ],
+ "Examples": [
+ [
+ "{{div 6 3}}",
+ "2"
+ ]
+ ]
+ },
+ "Floor": {
+ "Description": "Floor returns the greatest integer value less than or equal to x.",
+ "Args": [
+ "x"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{math.Floor 1.9}}",
+ "1"
+ ]
+ ]
+ },
+ "Log": {
+ "Description": "Log returns the natural logarithm of a number.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{math.Log 1}}",
+ "0"
+ ]
+ ]
+ },
+ "Max": {
+ "Description": "Max returns the greater of two numbers.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{math.Max 1 2 }}",
+ "2"
+ ]
+ ]
+ },
+ "Min": {
+ "Description": "Min returns the smaller of two numbers.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{math.Min 1 2 }}",
+ "1"
+ ]
+ ]
+ },
+ "Mod": {
+ "Description": "Mod returns a % b.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "mod"
+ ],
+ "Examples": [
+ [
+ "{{mod 15 3}}",
+ "0"
+ ]
+ ]
+ },
+ "ModBool": {
+ "Description": "ModBool returns the boolean of a % b. If a % b == 0, return true.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "modBool"
+ ],
+ "Examples": [
+ [
+ "{{modBool 15 3}}",
+ "true"
+ ]
+ ]
+ },
+ "Mul": {
+ "Description": "Mul multiplies two numbers.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "mul"
+ ],
+ "Examples": [
+ [
+ "{{mul 2 3}}",
+ "6"
+ ]
+ ]
+ },
+ "Pow": {
+ "Description": "Pow returns a raised to the power of b.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "pow"
+ ],
+ "Examples": [
+ [
+ "{{math.Pow 2 3}}",
+ "8"
+ ]
+ ]
+ },
+ "Round": {
+ "Description": "Round returns the nearest integer, rounding half away from zero.",
+ "Args": [
+ "x"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{math.Round 1.5}}",
+ "2"
+ ]
+ ]
+ },
+ "Sqrt": {
+ "Description": "Sqrt returns the square root of a number.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{math.Sqrt 81}}",
+ "9"
+ ]
+ ]
+ },
+ "Sub": {
+ "Description": "Sub subtracts two numbers.",
+ "Args": [
+ "a",
+ "b"
+ ],
+ "Aliases": [
+ "sub"
+ ],
+ "Examples": [
+ [
+ "{{sub 3 2}}",
+ "1"
+ ]
+ ]
+ }
+ },
+ "openapi3": {
+ "Unmarshal": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": []
+ }
+ },
+ "os": {
+ "FileExists": {
+ "Description": "FileExists checks whether a file exists under the given path.",
+ "Args": [
+ "i"
+ ],
+ "Aliases": [
+ "fileExists"
+ ],
+ "Examples": [
+ [
+ "{{ fileExists \"foo.txt\" }}",
+ "false"
+ ]
+ ]
+ },
+ "Getenv": {
+ "Description": "Getenv retrieves the value of the environment variable named by the key.\nIt returns the value, which will be empty if the variable is not present.",
+ "Args": [
+ "key"
+ ],
+ "Aliases": [
+ "getenv"
+ ],
+ "Examples": []
+ },
+ "ReadDir": {
+ "Description": "ReadDir lists the directory contents relative to the configured WorkingDir.",
+ "Args": [
+ "i"
+ ],
+ "Aliases": [
+ "readDir"
+ ],
+ "Examples": [
+ [
+ "{{ range (readDir \"files\") }}{{ .Name }}{{ end }}",
+ "README.txt"
+ ]
+ ]
+ },
+ "ReadFile": {
+ "Description": "ReadFile reads the file named by filename relative to the configured WorkingDir.\nIt returns the contents as a string.\nThere is an upper size limit set at 1 megabytes.",
+ "Args": [
+ "i"
+ ],
+ "Aliases": [
+ "readFile"
+ ],
+ "Examples": [
+ [
+ "{{ readFile \"files/README.txt\" }}",
+ "Hugo Rocks!"
+ ]
+ ]
+ },
+ "Stat": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ }
+ },
+ "partials": {
+ "Include": {
+ "Description": "Include executes the named partial.\nIf the partial contains a return statement, that value will be returned.\nElse, the rendered output will be returned:\nA string if the partial is a text/template, or template.HTML when html/template.",
+ "Args": [
+ "name",
+ "contextList"
+ ],
+ "Aliases": [
+ "partial"
+ ],
+ "Examples": [
+ [
+ "{{ partial \"header.html\" . }}",
+ "\u003ctitle\u003eHugo Rocks!\u003c/title\u003e"
+ ]
+ ]
+ },
+ "IncludeCached": {
+ "Description": "IncludeCached executes and caches partial templates. The cache is created with name+variants as the key.",
+ "Args": [
+ "name",
+ "context",
+ "variants"
+ ],
+ "Aliases": [
+ "partialCached"
+ ],
+ "Examples": []
+ }
+ },
+ "path": {
+ "Base": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Dir": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Ext": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Join": {
+ "Description": "Join joins any number of path elements into a single path, adding a\nseparating slash if necessary. All the input\npath elements are passed into filepath.ToSlash converting any Windows slashes\nto forward slashes.\nThe result is Cleaned; in particular,\nall empty strings are ignored.",
+ "Args": [
+ "elements"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ slice \"my/path\" \"filename.txt\" | path.Join }}",
+ "my/path/filename.txt"
+ ],
+ [
+ "{{ path.Join \"my\" \"path\" \"filename.txt\" }}",
+ "my/path/filename.txt"
+ ],
+ [
+ "{{ \"my/path/filename.txt\" | path.Ext }}",
+ ".txt"
+ ],
+ [
+ "{{ \"my/path/filename.txt\" | path.Base }}",
+ "filename.txt"
+ ],
+ [
+ "{{ \"my/path/filename.txt\" | path.Dir }}",
+ "my/path"
+ ]
+ ]
+ },
+ "Split": {
+ "Description": "Split splits path immediately following the final slash,\nseparating it into a directory and file name component.\nIf there is no slash in path, Split returns an empty dir and\nfile set to path.\nThe input path is passed into filepath.ToSlash converting any Windows slashes\nto forward slashes.\nThe returned values have the property that path = dir+file.",
+ "Args": [
+ "path"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"/my/path/filename.txt\" | path.Split }}",
+ "/my/path/|filename.txt"
+ ],
+ [
+ "{{ \"/my/path/filename.txt\" | path.Split }}",
+ "/my/path/|filename.txt"
+ ]
+ ]
+ }
+ },
+ "reflect": {
+ "IsMap": {
+ "Description": "IsMap reports whether v is a map.",
+ "Args": [
+ "v"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ if reflect.IsMap (dict \"a\" 1) }}Map{{ end }}",
+ "Map"
+ ]
+ ]
+ },
+ "IsSlice": {
+ "Description": "IsSlice reports whether v is a slice.",
+ "Args": [
+ "v"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ if reflect.IsSlice (slice 1 2 3) }}Slice{{ end }}",
+ "Slice"
+ ]
+ ]
+ }
+ },
+ "resources": {
+ "Babel": {
+ "Description": "Babel processes the given Resource with Babel.",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "babel"
+ ],
+ "Examples": []
+ },
+ "Concat": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "ExecuteAsTemplate": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Fingerprint": {
+ "Description": "Fingerprint transforms the given Resource with a MD5 hash of the content in\nthe RelPermalink and Permalink.",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "fingerprint"
+ ],
+ "Examples": []
+ },
+ "FromString": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Get": {
+ "Description": "Get locates the filename given in Hugo's assets filesystem\nand creates a Resource object that can be used for further transformations.",
+ "Args": [
+ "filename"
+ ],
+ "Aliases": null,
+ "Examples": []
+ },
+ "GetMatch": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Match": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Minify": {
+ "Description": "Minify minifies the given Resource using the MediaType to pick the correct\nminifier.",
+ "Args": [
+ "r"
+ ],
+ "Aliases": [
+ "minify"
+ ],
+ "Examples": []
+ },
+ "PostCSS": {
+ "Description": "PostCSS processes the given Resource with PostCSS",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "postCSS"
+ ],
+ "Examples": []
+ },
+ "PostProcess": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "ToCSS": {
+ "Description": "ToCSS converts the given Resource to CSS. You can optional provide an Options\nobject or a target path (string) as first argument.",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "toCSS"
+ ],
+ "Examples": []
+ }
+ },
+ "safe": {
+ "CSS": {
+ "Description": "CSS returns a given string as html/template CSS content.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "safeCSS"
+ ],
+ "Examples": [
+ [
+ "{{ \"Bat\u0026Man\" | safeCSS | safeCSS }}",
+ "Bat\u0026amp;Man"
+ ]
+ ]
+ },
+ "HTML": {
+ "Description": "HTML returns a given string as html/template HTML content.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "safeHTML"
+ ],
+ "Examples": [
+ [
+ "{{ \"Bat\u0026Man\" | safeHTML | safeHTML }}",
+ "Bat\u0026Man"
+ ],
+ [
+ "{{ \"Bat\u0026Man\" | safeHTML }}",
+ "Bat\u0026Man"
+ ]
+ ]
+ },
+ "HTMLAttr": {
+ "Description": "HTMLAttr returns a given string as html/template HTMLAttr content.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "safeHTMLAttr"
+ ],
+ "Examples": []
+ },
+ "JS": {
+ "Description": "JS returns the given string as a html/template JS content.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "safeJS"
+ ],
+ "Examples": [
+ [
+ "{{ \"(1*2)\" | safeJS | safeJS }}",
+ "(1*2)"
+ ]
+ ]
+ },
+ "JSStr": {
+ "Description": "JSStr returns the given string as a html/template JSStr content.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "safeJSStr"
+ ],
+ "Examples": []
+ },
+ "SanitizeURL": {
+ "Description": "SanitizeURL returns a given string as html/template URL content.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "sanitizeURL",
+ "sanitizeurl"
+ ],
+ "Examples": []
+ },
+ "URL": {
+ "Description": "URL returns a given string as html/template URL content.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "safeURL"
+ ],
+ "Examples": [
+ [
+ "{{ \"http://gohugo.io\" | safeURL | safeURL }}",
+ "http://gohugo.io"
+ ]
+ ]
+ }
+ },
+ "site": {
+ "BaseURL": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Data": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Hugo": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "IsServer": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Language": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "LastChange": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Menus": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Pages": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Params": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "RegularPages": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "ServerPort": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Sites": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Taxonomies": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Title": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ }
+ },
+ "strings": {
+ "Chomp": {
+ "Description": "Chomp returns a copy of s with all trailing newline characters removed.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "chomp"
+ ],
+ "Examples": [
+ [
+ "{{chomp \"\u003cp\u003eBlockhead\u003c/p\u003e\\n\" | safeHTML }}",
+ "\u003cp\u003eBlockhead\u003c/p\u003e"
+ ]
+ ]
+ },
+ "Contains": {
+ "Description": "Contains reports whether substr is in s.",
+ "Args": [
+ "s",
+ "substr"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ strings.Contains \"abc\" \"b\" }}",
+ "true"
+ ],
+ [
+ "{{ strings.Contains \"abc\" \"d\" }}",
+ "false"
+ ]
+ ]
+ },
+ "ContainsAny": {
+ "Description": "ContainsAny reports whether any Unicode code points in chars are within s.",
+ "Args": [
+ "s",
+ "chars"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ strings.ContainsAny \"abc\" \"bcd\" }}",
+ "true"
+ ],
+ [
+ "{{ strings.ContainsAny \"abc\" \"def\" }}",
+ "false"
+ ]
+ ]
+ },
+ "Count": {
+ "Description": "Count counts the number of non-overlapping instances of substr in s.\nIf substr is an empty string, Count returns 1 + the number of Unicode code points in s.",
+ "Args": [
+ "substr",
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{\"aabab\" | strings.Count \"a\" }}",
+ "3"
+ ]
+ ]
+ },
+ "CountRunes": {
+ "Description": "CountRunes returns the number of runes in s, excluding whitespace.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "countrunes"
+ ],
+ "Examples": []
+ },
+ "CountWords": {
+ "Description": "CountWords returns the approximate word count in s.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "countwords"
+ ],
+ "Examples": []
+ },
+ "FindRE": {
+ "Description": "FindRE returns a list of strings that match the regular expression. By default all matches\nwill be included. The number of matches can be limited with an optional third parameter.",
+ "Args": [
+ "expr",
+ "content",
+ "limit"
+ ],
+ "Aliases": [
+ "findRE"
+ ],
+ "Examples": [
+ [
+ "{{ findRE \"[G|g]o\" \"Hugo is a static side generator written in Go.\" \"1\" }}",
+ "[go]"
+ ]
+ ]
+ },
+ "FirstUpper": {
+ "Description": "FirstUpper returns a string with the first character as upper case.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"hugo rocks!\" | strings.FirstUpper }}",
+ "Hugo rocks!"
+ ]
+ ]
+ },
+ "HasPrefix": {
+ "Description": "HasPrefix tests whether the input s begins with prefix.",
+ "Args": [
+ "s",
+ "prefix"
+ ],
+ "Aliases": [
+ "hasPrefix"
+ ],
+ "Examples": [
+ [
+ "{{ hasPrefix \"Hugo\" \"Hu\" }}",
+ "true"
+ ],
+ [
+ "{{ hasPrefix \"Hugo\" \"Fu\" }}",
+ "false"
+ ]
+ ]
+ },
+ "HasSuffix": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Repeat": {
+ "Description": "Repeat returns a new string consisting of count copies of the string s.",
+ "Args": [
+ "n",
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"yo\" | strings.Repeat 4 }}",
+ "yoyoyoyo"
+ ]
+ ]
+ },
+ "Replace": {
+ "Description": "Replace returns a copy of the string s with all occurrences of old replaced\nwith new. The number of replacements can be limited with an optional fourth\nparameter.",
+ "Args": [
+ "s",
+ "old",
+ "new",
+ "limit"
+ ],
+ "Aliases": [
+ "replace"
+ ],
+ "Examples": [
+ [
+ "{{ replace \"Batman and Robin\" \"Robin\" \"Catwoman\" }}",
+ "Batman and Catwoman"
+ ],
+ [
+ "{{ replace \"aabbaabb\" \"a\" \"z\" 2 }}",
+ "zzbbaabb"
+ ]
+ ]
+ },
+ "ReplaceRE": {
+ "Description": "ReplaceRE returns a copy of s, replacing all matches of the regular\nexpression pattern with the replacement text repl. The number of replacements\ncan be limited with an optional fourth parameter.",
+ "Args": [
+ "pattern",
+ "repl",
+ "s",
+ "n"
+ ],
+ "Aliases": [
+ "replaceRE"
+ ],
+ "Examples": [
+ [
+ "{{ replaceRE \"a+b\" \"X\" \"aabbaabbab\" }}",
+ "XbXbX"
+ ],
+ [
+ "{{ replaceRE \"a+b\" \"X\" \"aabbaabbab\" 1 }}",
+ "Xbaabbab"
+ ]
+ ]
+ },
+ "RuneCount": {
+ "Description": "RuneCount returns the number of runes in s.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": []
+ },
+ "SliceString": {
+ "Description": "SliceString slices a string by specifying a half-open range with\ntwo indices, start and end. 1 and 4 creates a slice including elements 1 through 3.\nThe end index can be omitted, it defaults to the string's length.",
+ "Args": [
+ "a",
+ "startEnd"
+ ],
+ "Aliases": [
+ "slicestr"
+ ],
+ "Examples": [
+ [
+ "{{slicestr \"BatMan\" 0 3}}",
+ "Bat"
+ ],
+ [
+ "{{slicestr \"BatMan\" 3}}",
+ "Man"
+ ]
+ ]
+ },
+ "Split": {
+ "Description": "Split slices an input string into all substrings separated by delimiter.",
+ "Args": [
+ "a",
+ "delimiter"
+ ],
+ "Aliases": [
+ "split"
+ ],
+ "Examples": []
+ },
+ "Substr": {
+ "Description": "Substr extracts parts of a string, beginning at the character at the specified\nposition, and returns the specified number of characters.\n\nIt normally takes two parameters: start and length.\nIt can also take one parameter: start, i.e. length is omitted, in which case\nthe substring starting from start until the end of the string will be returned.\n\nTo extract characters from the end of the string, use a negative start number.\n\nIn addition, borrowing from the extended behavior described at http://php.net/substr,\nif length is given and is negative, then that many characters will be omitted from\nthe end of string.",
+ "Args": [
+ "a",
+ "nums"
+ ],
+ "Aliases": [
+ "substr"
+ ],
+ "Examples": [
+ [
+ "{{substr \"BatMan\" 0 -3}}",
+ "Bat"
+ ],
+ [
+ "{{substr \"BatMan\" 3 3}}",
+ "Man"
+ ]
+ ]
+ },
+ "Title": {
+ "Description": "Title returns a copy of the input s with all Unicode letters that begin words\nmapped to their title case.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "title"
+ ],
+ "Examples": [
+ [
+ "{{title \"Bat man\"}}",
+ "Bat Man"
+ ],
+ [
+ "{{title \"somewhere over the rainbow\"}}",
+ "Somewhere Over the Rainbow"
+ ]
+ ]
+ },
+ "ToLower": {
+ "Description": "ToLower returns a copy of the input s with all Unicode letters mapped to their\nlower case.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "lower"
+ ],
+ "Examples": [
+ [
+ "{{lower \"BatMan\"}}",
+ "batman"
+ ]
+ ]
+ },
+ "ToUpper": {
+ "Description": "ToUpper returns a copy of the input s with all Unicode letters mapped to their\nupper case.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "upper"
+ ],
+ "Examples": [
+ [
+ "{{upper \"BatMan\"}}",
+ "BATMAN"
+ ]
+ ]
+ },
+ "Trim": {
+ "Description": "Trim returns a string with all leading and trailing characters defined\ncontained in cutset removed.",
+ "Args": [
+ "s",
+ "cutset"
+ ],
+ "Aliases": [
+ "trim"
+ ],
+ "Examples": [
+ [
+ "{{ trim \"++Batman--\" \"+-\" }}",
+ "Batman"
+ ]
+ ]
+ },
+ "TrimLeft": {
+ "Description": "TrimLeft returns a slice of the string s with all leading characters\ncontained in cutset removed.",
+ "Args": [
+ "cutset",
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"aabbaa\" | strings.TrimLeft \"a\" }}",
+ "bbaa"
+ ]
+ ]
+ },
+ "TrimPrefix": {
+ "Description": "TrimPrefix returns s without the provided leading prefix string. If s doesn't\nstart with prefix, s is returned unchanged.",
+ "Args": [
+ "prefix",
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"aabbaa\" | strings.TrimPrefix \"a\" }}",
+ "abbaa"
+ ],
+ [
+ "{{ \"aabbaa\" | strings.TrimPrefix \"aa\" }}",
+ "bbaa"
+ ]
+ ]
+ },
+ "TrimRight": {
+ "Description": "TrimRight returns a slice of the string s with all trailing characters\ncontained in cutset removed.",
+ "Args": [
+ "cutset",
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"aabbaa\" | strings.TrimRight \"a\" }}",
+ "aabb"
+ ]
+ ]
+ },
+ "TrimSuffix": {
+ "Description": "TrimSuffix returns s without the provided trailing suffix string. If s\ndoesn't end with suffix, s is returned unchanged.",
+ "Args": [
+ "suffix",
+ "s"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"aabbaa\" | strings.TrimSuffix \"a\" }}",
+ "aabba"
+ ],
+ [
+ "{{ \"aabbaa\" | strings.TrimSuffix \"aa\" }}",
+ "aabb"
+ ]
+ ]
+ },
+ "Truncate": {
+ "Description": "Truncate truncates a given string to the specified length.",
+ "Args": [
+ "a",
+ "options"
+ ],
+ "Aliases": [
+ "truncate"
+ ],
+ "Examples": [
+ [
+ "{{ \"this is a very long text\" | truncate 10 \" ...\" }}",
+ "this is a ..."
+ ],
+ [
+ "{{ \"With [Markdown](/markdown) inside.\" | markdownify | truncate 14 }}",
+ "With \u003ca href=\"/markdown\"\u003eMarkdown …\u003c/a\u003e"
+ ]
+ ]
+ }
+ },
+ "templates": {
+ "Exists": {
+ "Description": "Exists returns whether the template with the given name exists.\nNote that this is the Unix-styled relative path including filename suffix,\ne.g. partials/header.html",
+ "Args": [
+ "name"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ if (templates.Exists \"partials/header.html\") }}Yes!{{ end }}",
+ "Yes!"
+ ],
+ [
+ "{{ if not (templates.Exists \"partials/doesnotexist.html\") }}No!{{ end }}",
+ "No!"
+ ]
+ ]
+ }
+ },
+ "time": {
+ "AsTime": {
+ "Description": "AsTime converts the textual representation of the datetime string into\na time.Time interface.",
+ "Args": [
+ "v",
+ "args"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ (time \"2015-01-21\").Year }}",
+ "2015"
+ ]
+ ]
+ },
+ "Duration": {
+ "Description": "Duration converts the given number to a time.Duration.\nUnit is one of nanosecond/ns, microsecond/us/µs, millisecond/ms, second/s, minute/m or hour/h.",
+ "Args": [
+ "unit",
+ "number"
+ ],
+ "Aliases": [
+ "duration"
+ ],
+ "Examples": [
+ [
+ "{{ mul 60 60 | duration \"second\" }}",
+ "1h0m0s"
+ ]
+ ]
+ },
+ "Format": {
+ "Description": "Format converts the textual representation of the datetime string into\nthe other form or returns it of the time.Time value. These are formatted\nwith the layout string",
+ "Args": [
+ "layout",
+ "v"
+ ],
+ "Aliases": [
+ "dateFormat"
+ ],
+ "Examples": [
+ [
+ "dateFormat: {{ dateFormat \"Monday, Jan 2, 2006\" \"2015-01-21\" }}",
+ "dateFormat: Wednesday, Jan 21, 2015"
+ ]
+ ]
+ },
+ "Now": {
+ "Description": "Now returns the current local time.",
+ "Args": null,
+ "Aliases": [
+ "now"
+ ],
+ "Examples": []
+ },
+ "ParseDuration": {
+ "Description": "ParseDuration parses a duration string.\nA duration string is a possibly signed sequence of\ndecimal numbers, each with optional fraction and a unit suffix,\nsuch as \"300ms\", \"-1.5h\" or \"2h45m\".\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\nSee https://golang.org/pkg/time/#ParseDuration",
+ "Args": [
+ "in"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"1h12m10s\" | time.ParseDuration }}",
+ "1h12m10s"
+ ]
+ ]
+ }
+ },
+ "transform": {
+ "Emojify": {
+ "Description": "Emojify returns a copy of s with all emoji codes replaced with actual emojis.\n\nSee http://www.emoji-cheat-sheet.com/",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "emojify"
+ ],
+ "Examples": [
+ [
+ "{{ \"I :heart: Hugo\" | emojify }}",
+ "I ❤️ Hugo"
+ ]
+ ]
+ },
+ "HTMLEscape": {
+ "Description": "HTMLEscape returns a copy of s with reserved HTML characters escaped.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "htmlEscape"
+ ],
+ "Examples": [
+ [
+ "{{ htmlEscape \"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e\" | safeHTML}}",
+ "Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;"
+ ],
+ [
+ "{{ htmlEscape \"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e\"}}",
+ "Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;"
+ ],
+ [
+ "{{ htmlEscape \"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e\" | htmlUnescape | safeHTML }}",
+ "Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e"
+ ]
+ ]
+ },
+ "HTMLUnescape": {
+ "Description": "HTMLUnescape returns a copy of with HTML escape requences converted to plain\ntext.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "htmlUnescape"
+ ],
+ "Examples": [
+ [
+ "{{ htmlUnescape \"Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;\" | safeHTML}}",
+ "Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e"
+ ],
+ [
+ "{{\"Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;\" | htmlUnescape | htmlUnescape | safeHTML}}",
+ "Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e"
+ ],
+ [
+ "{{\"Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;\" | htmlUnescape | htmlUnescape }}",
+ "Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;"
+ ],
+ [
+ "{{ htmlUnescape \"Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;\" | htmlEscape | safeHTML }}",
+ "Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;"
+ ]
+ ]
+ },
+ "Highlight": {
+ "Description": "Highlight returns a copy of s as an HTML string with syntax\nhighlighting applied.",
+ "Args": [
+ "s",
+ "lang",
+ "opts"
+ ],
+ "Aliases": [
+ "highlight"
+ ],
+ "Examples": []
+ },
+ "Markdownify": {
+ "Description": "Markdownify renders a given input from Markdown to HTML.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "markdownify"
+ ],
+ "Examples": [
+ [
+ "{{ .Title | markdownify}}",
+ "\u003cstrong\u003eBatMan\u003c/strong\u003e"
+ ]
+ ]
+ },
+ "Plainify": {
+ "Description": "Plainify returns a copy of s with all HTML tags removed.",
+ "Args": [
+ "s"
+ ],
+ "Aliases": [
+ "plainify"
+ ],
+ "Examples": [
+ [
+ "{{ plainify \"Hello \u003cstrong\u003eworld\u003c/strong\u003e, gophers!\" }}",
+ "Hello world, gophers!"
+ ]
+ ]
+ },
+ "Remarshal": {
+ "Description": "Remarshal is used in the Hugo documentation to convert configuration\nexamples from YAML to JSON, TOML (and possibly the other way around).\nThe is primarily a helper for the Hugo docs site.\nIt is not a general purpose YAML to TOML converter etc., and may\nchange without notice if it serves a purpose in the docs.\nFormat is one of json, yaml or toml.",
+ "Args": [
+ "format",
+ "data"
+ ],
+ "Aliases": null,
+ "Examples": [
+ [
+ "{{ \"title = \\\"Hello World\\\"\" | transform.Remarshal \"json\" | safeHTML }}",
+ "{\n \"title\": \"Hello World\"\n}\n"
+ ]
+ ]
+ },
+ "Unmarshal": {
+ "Description": "Unmarshal unmarshals the data given, which can be either a string, json.RawMessage\nor a Resource. Supported formats are JSON, TOML, YAML, and CSV.\nYou can optionally provide an options map as the first argument.",
+ "Args": [
+ "args"
+ ],
+ "Aliases": [
+ "unmarshal"
+ ],
+ "Examples": [
+ [
+ "{{ \"hello = \\\"Hello World\\\"\" | transform.Unmarshal }}",
+ "map[hello:Hello World]"
+ ],
+ [
+ "{{ \"hello = \\\"Hello World\\\"\" | resources.FromString \"data/greetings.toml\" | transform.Unmarshal }}",
+ "map[hello:Hello World]"
+ ]
+ ]
+ }
+ },
+ "urls": {
+ "AbsLangURL": {
+ "Description": "AbsLangURL takes a given string and converts it to an absolute URL according\nto a page's position in the project directory structure and the current\nlanguage.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "absLangURL"
+ ],
+ "Examples": []
+ },
+ "AbsURL": {
+ "Description": "AbsURL takes a given string and converts it to an absolute URL.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "absURL"
+ ],
+ "Examples": []
+ },
+ "Anchorize": {
+ "Description": "Anchorize creates sanitized anchor names that are compatible with Blackfriday.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "anchorize"
+ ],
+ "Examples": [
+ [
+ "{{ \"This is a title\" | anchorize }}",
+ "this-is-a-title"
+ ]
+ ]
+ },
+ "Parse": {
+ "Description": "",
+ "Args": null,
+ "Aliases": null,
+ "Examples": null
+ },
+ "Ref": {
+ "Description": "Ref returns the absolute URL path to a given content item.",
+ "Args": [
+ "in",
+ "args"
+ ],
+ "Aliases": [
+ "ref"
+ ],
+ "Examples": []
+ },
+ "RelLangURL": {
+ "Description": "RelLangURL takes a given string and prepends the relative path according to a\npage's position in the project directory structure and the current language.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "relLangURL"
+ ],
+ "Examples": []
+ },
+ "RelRef": {
+ "Description": "RelRef returns the relative URL path to a given content item.",
+ "Args": [
+ "in",
+ "args"
+ ],
+ "Aliases": [
+ "relref"
+ ],
+ "Examples": []
+ },
+ "RelURL": {
+ "Description": "RelURL takes a given string and prepends the relative path according to a\npage's position in the project directory structure.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "relURL"
+ ],
+ "Examples": []
+ },
+ "URLize": {
+ "Description": "URLize returns the given argument formatted as URL.",
+ "Args": [
+ "a"
+ ],
+ "Aliases": [
+ "urlize"
+ ],
+ "Examples": []
+ }
+ }
+ }
+ }
+}
--- /dev/null
- [[tweet]]
- name = "Jens Munch"
- twitter_handle = "@jensamunch"
- quote = "Hugo is really, really incredible... Now does resizing/resampling of images as well! Crazy that something so fast can be a static site generator... Amazing open-source project."
- link = "https://twitter.com/jensamunch/status/948533063537086464"
- date = 2018-01-03T04:00:00Z
-
- [[tweet]]
- name = "STOQE"
- twitter_handle = "@STOQE"
- quote = "I fear <a href='https://twitter.com/gohugoio' target='_blank'>@GoHugoIO</a> v0.22 might be so fast it creates a code vortex that time-warps me back to a time I used Wordpress. <a href='https://twitter.com/hashtag/gasp?src=hash'>#gasp</a>"
- link = "https://twitter.com/STOQE/status/874184881701494784"
- date = 2017-06-12T00:00:00Z
-
+[[tweet]]
+name = "Heinrich Hartmann"
+twitter_handle = "@heinrichhartman"
+quote = "Working with @GoHugoIO is such a joy. Having worked with #Jekyll in the past, the near instant preview is a big win! Did not expect this to make such a huge difference."
+link = "https://twitter.com/heinrichhartman/status/1199736512264462341"
+date = 2019-11-12T00:00:00Z
+
+[[tweet]]
+name = "Joshua Steven"
+twitter_handle = "@jscarto"
+quote = "Can't overstate how much I enjoy <a href='https://twitter.com/gohugoio' target='_blank'>@GoHugoIO</a>. My site is relatively small, but *18 ms* to build the whole thing made template development and proofing a breeze."
+link = "https://twitter.com/jscarto/status/1039648827815485440"
+date = 2018-09-12T00:00:00Z
+
+[[tweet]]
+name = "Christophe Diericx"
+twitter_handle = "@spcrngr_"
+quote = "The more I use <a href='https://gohugo.io' target='_blank'>gohugo.io</a>, the more I really like it. Super intuitive/powerful static site generator...great job <a href='https://twitter.com/gohugoio' target='_blank'>@GoHugoIO</a>"
+link = "https://twitter.com/spcrngr_/status/870863020905435136"
+date = 2017-06-03T00:00:00Z
+
+[[tweet]]
+name = "marcoscan"
+twitter_handle = "@marcoscan"
+quote = "Blog migrated from <a href='https://twitter.com/WordPress' target='_blank'>@WordPress</a> to <a href='https://twitter.com/GoHugoIO' target='_blank'>@GoHugoIO</a>, with a little refresh of my theme, Vim shortcuts and a full featured deploy script <a href='https://twitter.com/hashtag/gohugo?src=hash' target='_blank'>#gohugo</a>"
+link = "https://twitter.com/marcoscan/status/869661175960752129"
+date = 2017-05-30T00:00:00Z
+
+[[tweet]]
+name = "Sandra Kuipers"
+twitter_handle = "@SKuipersDesign"
+quote = "Who knew static site building could be fun 🤔 Learning <a href='https://twitter.com/hashtag/gohugo?src=hash'>#gohugo</a> today"
+link = "https://twitter.com/SKuipersDesign/status/868796256902029312"
+date = 2017-05-28T00:00:00Z
+
+[[tweet]]
+name = "Netlify"
+twitter_handle = "@Netlify"
+quote = "Top Ten Static Site Generators of 2017. Congrats to the top 3: 1. <a href='https://twitter.com/jekyllrb'>@Jekyllrb</a> 2. <a href='https://twitter.com/GoHugoIO'>@GoHugoIO</a> 3. <a href='https://twitter.com/hexojs'>@hexojs</a>"
+link = "https://twitter.com/Netlify/status/868122279221362688"
+date = 2017-05-26T00:00:00Z
+
+[[tweet]]
+name = "Phil Hawksworth"
+twitter_handle = "@philhawksworth"
+quote = "I've been keen on <a href='https://twitter.com/hashtag/JAMStack?src=hash' target='_blank'>#JAMStack</a> for some time, but <a href='https://twitter.com/gohugoio' target='_blank'>@GoHugoIO</a> is wooing me all over again. Great fun to build with. And speeeeedy."
+link = "https://twitter.com/philhawksworth/status/866684170512326657"
+date = 2017-05-22T00:00:00Z
+
+[[tweet]]
+name = "Aras Pranckevicius"
+twitter_handle = "@aras_p"
+quote = "I've probably said it before...but having Hugo rebuild the whole website in 300ms is amazing. <a href='https://gohugo.io' target='_blank'>gohugo.io</a>, <a href='https://twitter.com/hashtag/gohugo' target='_blank'>#gohugo</a>"
+link = "https://twitter.com/aras_p/status/861157286823288832"
+date = 2017-05-07T00:00:00Z
+
+[[tweet]]
+name = "Hans Beck"
+twitter_handle = "@EnrichedGamesHB"
+quote = "Diving deeper into <a href='https://twitter.com/GoHugoIO' target='_blank' rel='noopener noreferrer'>@GoHugoIO</a>. A lot of docs there, top work! But I've the impressed that <a href='https://twitter.com/hashtag/gohugo' target='_blank' rel='noopener noreferrer'>#gohugo</a> is far easier than its feels from the docs!"
+link = "https://twitter.com/EnrichedGamesHB/status/836854762440130560"
+date = 2017-03-01T00:00:00Z
+
+[[tweet]]
+name = "Alan Richardson"
+twitter_handle = "@eviltester"
+quote = "I migrated the <a href='https://twitter.com/BlackOpsTesting' target='_blank' rel='noopener noreferrer'> @BlackOpsTesting </a>.com website from docpad to Hugo last weekend. http://gohugo.io/ Super Fast HTML Generation <a href='https://twitter.com/spf13' target='_blank' rel='noopener noreferrer'> @spf13 </a>"
+link = "https://twitter.com/eviltester/status/553520335115808768"
+date = 2015-01-09T00:00:00Z
+
+[[tweet]]
+name = "Janez Čadež"
+twitter_handle = "@jamziSLO"
+quote = "Building <a href='https://twitter.com/garazaFRI' target='_blank' rel='noopener noreferrer'>@garazaFRI</a> website in <a href='https://twitter.com/hashtag/hugo' target='_blank' rel='noopener noreferrer'>#hugo</a>. This static site generator is soooo damn fast! <a href='https://twitter.com/hashtag/gohugo' target='_blank' rel='noopener noreferrer'>#gohugo</a> <a href='https://twitter.com/hashtag/golang' target='_blank' rel='noopener noreferrer'>#golang</a>"
+link = "https://twitter.com/jamziSLO/status/817720283977183234"
+date = 2017-01-07T00:00:00Z
+
+[[tweet]]
+name = "Execute"
+twitter_handle = "@executerun"
+quote = "Hah, <a href='https://twitter.com/hashtag/gohugo' target='_blank' rel='noopener noreferrer'>#gohugo</a>. I was working with <a href='https://twitter.com/hashtag/gohugo' target='_blank' rel='noopener noreferrer'>#gohugo</a> on <a href='https://twitter.com/hashtag/linux' target='_blank' rel='noopener noreferrer'>#linux</a> but now I realised how easy is to set-up it on <a href='https://twitter.com/hashtag/windows' target='_blank' rel='noopener noreferrer'>#windows</a>. Just need to add binary to <a href='https://twitter.com/hashtag/path' target='_blank' rel='noopener noreferrer'>#path</a>!"
+link = "https://twitter.com/executerun/status/809753145270272005"
+date = 2016-12-16T00:00:00Z
+
+[[tweet]]
+name = "Baron Schwartz"
+twitter_handle = "@xaprb"
+quote = "Hugo is impressively capable. It's a static site generator by <a href='https://twitter.com/spf13'> @spf13 </a> written in <a href='https://twitter.com/hashtag/golang?src=hash'> #golang </a> . Just upgraded to latest release; very powerful. "
+link = "https://twitter.com/xaprb/status/556894866488455169"
+date = 2015-01-18T00:00:00Z
+
+[[tweet]]
+name = "Dave Cottlehuber"
+twitter_handle = "@dch__"
+quote = "I just fell in love with #hugo, a static site/blog engine written by @spf13 in #golang + stellar docs"
+link = "https://twitter.com/dch__/status/460158115498176512"
+date = 2014-04-26T00:00:00Z
+
+[[tweet]]
+name = "David Caunt"
+twitter_handle = "@dcaunt"
+quote = "I had a play with Hugo and it was good, uses Markdown files for content"
+link = "https://twitter.com/dcaunt/statuses/406466996277374976"
+date = 2013-11-29T00:00:00Z
+
+[[tweet]]
+name = "David Gay"
+twitter_handle = "@oddshocks"
+quote = "Hugo is super-rad."
+link = "https://twitter.com/oddshocks/statuses/405083217893421056"
+date = 2013-11-25T00:00:00Z
+
+[[tweet]]
+name = "Diti"
+twitter_handle = "@DitiPengi"
+quote = "The dev version of Hugo is AWESOME! <3 I promise, I will try to learn go ASAP and help contribute to the project! Just too great!"
+link = "https://twitter.com/DitiPengi/status/472470974051676160"
+date = 2014-05-30T00:00:00Z
+
+[[tweet]]
+name = "Douglas Stephen "
+twitter_handle = "@DougStephenJr"
+quote = "Even as a long-time Octopress fan, I’ve gotta admit that this project Hugo looks very very cool"
+link = "https://twitter.com/DougStephenJr/statuses/364512471660249088"
+date = 2013-08-05T00:00:00Z
+
+[[tweet]]
+name = "Hugo Rodger-Brown"
+twitter_handle = "@hugorodgerbrown"
+quote = "Finally someone builds me my own static site generator"
+link = "https://twitter.com/hugorodgerbrown/statuses/364417910153818112"
+date = 2013-05-08T00:00:00Z
+
+[[tweet]]
+name = "Hugo Roy"
+twitter_handle = "@hugoroyd"
+quote = "Finally the answer to the question my parents have been asking: What does Hugo do?"
+link = "https://twitter.com/hugoroyd/status/501704796727173120"
+date = 2014-08-19T00:00:00Z
+
+[[tweet]]
+name = "Daniel Miessler"
+twitter_handle = "@DanielMiessler"
+quote = "Websites for named vulnerabilities should run on static site generator platforms like Hugo. Read-only + burst traffic = static."
+link = "https://twitter.com/DanielMiessler/status/704703841673957376"
+date = 2016-03-01T00:00:00Z
+
+[[tweet]]
+name = "Javier Segura"
+twitter_handle = "@jsegura"
+quote = "Another site generated with Hugo here! I'm getting in love with it."
+link = "https://twitter.com/jsegura/status/465978434154659841"
+date = 2014-05-12T00:00:00Z
+
+[[tweet]]
+name = "Jim Biancolo"
+twitter_handle = "@jimbiancolo"
+quote = "I’m loving the static site generator renaissance we are currently enjoying. Hugo is new, looks great, written in Go"
+link = "https://twitter.com/jimbiancolo/statuses/408678420348813314"
+date = 2013-05-12T00:00:00Z
+
+[[tweet]]
+name = "Jip J. Dekker"
+twitter_handle = "@jipjdekker"
+quote = "Building a personal website in Hugo. Works like a charm. And written in @golang!"
+link = "https://twitter.com/jipjdekker/status/413783548735152131"
+date = 2013-12-19T00:00:00Z
+
+[[tweet]]
+name = "Jose Gonzalvo"
+twitter_handle = "@jgonzalvo"
+quote = "Checking out Hugo; Loving it so far. Like Jekyll but not so blog-oriented and written in go"
+link = "https://twitter.com/jgonzalvo/statuses/408177855819173888"
+date = 2013-12-04T00:00:00Z
+
+[[tweet]]
+name = "Josh Matz"
+twitter_handle = "@joshmatz"
+quote = "A static site generator without the long build times? Yes, please!"
+link = "https://twitter.com/joshmatz/statuses/364437436870696960"
+date = 2013-08-05T00:00:00Z
+
+[[tweet]]
+name = "Kieran Healy"
+twitter_handle = "@kjhealy"
+quote = "OK, so in today's speed battle of static site generators, @spf13's hugo is kicking everyone's ass, by miles."
+link = "https://twitter.com/kjhealy/status/437349384809115648"
+date = 2014-02-22T00:00:00Z
+
+[[tweet]]
+name = "Ludovic Chabant"
+twitter_handle = "@ludovicchabant"
+quote = "Good work on Hugo, I’m impressed with the speed!"
+link = "https://twitter.com/ludovicchabant/statuses/408806199602053120"
+date = 2013-12-06T00:00:00Z
+
+[[tweet]]
+name = "Luke Holder"
+twitter_handle = "@lukeholder"
+quote = "this is AWESOME. a single little executable and so fast."
+link = "https://twitter.com/lukeholder/status/430352287936946176"
+date = 2014-02-03T00:00:00Z
+
+[[tweet]]
+name = "Markus Eliasson"
+twitter_handle = "@markuseliasson"
+quote = "Hugo is fast, dead simple to setup and well documented"
+link = "https://twitter.com/markuseliasson/status/501594865877008384"
+date = 2014-08-19T00:00:00Z
+
+[[tweet]]
+name = "mercime"
+twitter_handle = "@mercime_one"
+quote = "Hugo: Makes the Web Fun Again"
+link = "https://twitter.com/mercime_one/status/500547145087205377"
+date = 2014-08-16T00:00:00Z
+
+[[tweet]]
+name = "Michael Whatcott"
+twitter_handle = "@mdwhatcott"
+quote = "One more satisfied #Hugo blogger. Thanks @spf13 and friends!"
+link = "https://twitter.com/mdwhatcott/status/469980686531571712"
+date = 2014-05-23T00:00:00Z
+
+[[tweet]]
+name = "Nathan Toups"
+twitter_handle = "@rojoroboto"
+quote = "I love Hugo! My site is generated with it now http://rjrbt.io"
+link = "https://twitter.com/rojoroboto/status/423439915620106242"
+date = 2014-01-15T00:00:00Z
+
+[[tweet]]
+name = "Ruben Solvang"
+twitter_handle = "@messo85"
+quote = "#Hugo is the new @jekyllrb / @middlemanapp! Faster, easier and runs everywhere."
+link = "https://twitter.com/messo85/status/472825062027182081"
+date = 2014-05-31T00:00:00Z
+
+[[tweet]]
+name = "Ryan Martinsen"
+twitter_handle = "@popthestack"
+quote = "Also, I re-launched my blog (it looks the same as before) using Hugo, a *fast* static engine. Very happy with it. <a href='http://gohugo.io/'>gohugo.io</a>"
+link = "https://twitter.com/popthestack/status/549972754125307904"
+date = 2014-12-30T00:00:00Z
+
+[[tweet]]
+name = "The Lone Cuber"
+twitter_handle = "@TheLoneCuber"
+quote = "Jekyll is dead to me these days though... long live Hugo! Hugo is *by far* the best in its field. Thanks for making it happen."
+link = "https://twitter.com/TheLoneCuber/status/495716684456398848"
+date = 2014-08-02T00:00:00Z
+
+[[tweet]]
+name = "The Lone Cuber"
+twitter_handle = "@TheLoneCuber"
+quote = "Finally, a publishing platform that's a joy to use. #NoMoreBarriers"
+link = "https://twitter.com/TheLoneCuber/status/495731334711488512"
+date = 2014-08-02T00:00:00Z
+
+[[tweet]]
+name = "WorkHTML"
+twitter_handle = "@workhtml"
+quote = "<a href='https://twitter.com/hashtag/Hugo?src=hash'> #Hugo </a> A very good alternative for <a href='https://twitter.com/hashtag/wordpress?src=hash'> #wordpress </a> !!! A fast and modern static website engine <a href='http://gohugo.io/'> gohugo.io </a>"
+link = "https://twitter.com/workhtml/status/563064361301053440"
+date = 2015-02-04T00:00:00Z
--- /dev/null
- HUGO_VERSION = "0.86.1"
+[build]
+publish = "public"
+command = "hugo --gc --minify"
+
+[context.production.environment]
- HUGO_VERSION = "0.86.1"
++HUGO_VERSION = "0.88.1"
+HUGO_ENV = "production"
+HUGO_ENABLEGITINFO = "true"
+
+[context.split1]
+command = "hugo --gc --minify --enableGitInfo"
+
+[context.split1.environment]
- HUGO_VERSION = "0.86.1"
++HUGO_VERSION = "0.88.1"
+HUGO_ENV = "production"
+
+[context.deploy-preview]
+command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
+
+[context.deploy-preview.environment]
- HUGO_VERSION = "0.86.1"
++HUGO_VERSION = "0.88.1"
+
+[context.branch-deploy]
+command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
+
+[context.branch-deploy.environment]
++HUGO_VERSION = "0.88.1"
+
+[context.next.environment]
+HUGO_ENABLEGITINFO = "true"
+
++[[redirects]]
++from = "/npmjs/*"
++to = "/npmjs/"
++status = 200
--- /dev/null
--- /dev/null
++<html>
++ <head>
++ <meta name="go-import" content="gohugo.io/npmjs mod http://localhost:8072">
++ </head>
++ <body></body>
++</html>