diff --git a/docs/content/about/new-in-032/index.md b/docs/content/about/new-in-032/index.md index 41bd58937..b8ca6430e 100644 --- a/docs/content/about/new-in-032/index.md +++ b/docs/content/about/new-in-032/index.md @@ -61,7 +61,7 @@ Note that changes to any resource inside the `content` folder will trigger a rel #### List all Resources -```html +```go-html-template {{ range .Resources }}
  • {{ .ResourceType | title }}
  • {{ end }} @@ -73,7 +73,7 @@ For an absolute URL, use `.Permalink`. #### List All Resources by Type -```html +```go-html-template {{ with .Resources.ByType "image" }} {{ end }} @@ -83,7 +83,7 @@ Type here is `page` for pages, else the main type in the MIME type, so `image`, #### Get a Specific Resource -```html +```go-html-template {{ $logo := .Resources.GetByPrefix "logo" }} {{ with $logo }} {{ end }} @@ -91,7 +91,7 @@ Type here is `page` for pages, else the main type in the MIME type, so `image`, #### Include Page Resource Content -```html +```go-html-template {{ with .Resources.ByType "page" }} {{ range . }}

    {{ .Title }}

    @@ -146,7 +146,7 @@ This is the shortcode used in the examples above: And it is used like this: -```html +```go-html-template {{}} ``` diff --git a/docs/content/content-management/comments.md b/docs/content/content-management/comments.md index 355bf0042..20932a825 100644 --- a/docs/content/content-management/comments.md +++ b/docs/content/content-management/comments.md @@ -27,15 +27,11 @@ Hugo comes with all the code you need to load Disqus into your templates. Before ### Configure Disqus -Disqus comments require you set a single value in your [site's configuration file][configuration]. The following show the configuration variable in a `config.toml` and `config.yml`, respectively: +Disqus comments require you set a single value in your [site's configuration file][configuration] like so: -``` +{{< code-toggle copy="false" >}} disqusShortname = "yourdiscussshortname" -``` - -``` -disqusShortname: "yourdiscussshortname" -``` +{{}} 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: diff --git a/docs/content/content-management/front-matter.md b/docs/content/content-management/front-matter.md index a6a3f2403..2fc18ee31 100644 --- a/docs/content/content-management/front-matter.md +++ b/docs/content/content-management/front-matter.md @@ -34,9 +34,9 @@ YAML JSON : a single JSON object surrounded by '`{`' and '`}`', followed by a new line. -### TOML Example +### 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." @@ -48,39 +48,7 @@ categories = [ ] slug = "spf13-vim-3-0-release-and-new-website" +++ -``` - -### YAML Example - -``` ---- -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" ] -lastmod: 2015-12-23 -date: "2012-04-06" -categories: - - "Development" - - "VIM" -slug: "spf13-vim-3-0-release-and-new-website" ---- -``` - -### JSON Example - -``` -{ - "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" -} -``` +{{}} ## Front Matter Variables diff --git a/docs/content/content-management/image-processing/index.md b/docs/content/content-management/image-processing/index.md index 1f84ba04d..ecc85bb51 100644 --- a/docs/content/content-management/image-processing/index.md +++ b/docs/content/content-management/image-processing/index.md @@ -23,7 +23,7 @@ The `image` is a [Page Resource]({{< relref "content-management/page-resources" To get all images in a [Page Bundle]({{< relref "content-management/organization#page-bundles" >}}): -```html +```go-html-template {{ with .Resources.ByType "image" }} {{ end }} @@ -131,7 +131,7 @@ This is the shortcode used in the examples above: And it is used like this: -```html +```go-html-template {{}} ``` diff --git a/docs/content/content-management/menus.md b/docs/content/content-management/menus.md index 1353ce0e2..c2eadf50f 100644 --- a/docs/content/content-management/menus.md +++ b/docs/content/content-management/menus.md @@ -118,9 +118,9 @@ menu: You can also add entries to menus that aren’t attached to a piece of content. This takes place in your Hugo project's [`config` file][config]. -Here’s an example snippet pulled from a `config.toml`: +Here’s an example snippet pulled from a configuration file: -{{< code file="config.toml" >}} +{{< code-toggle file="config.toml" >}} [[menu.main]] name = "about hugo" pre = "" @@ -132,23 +132,7 @@ Here’s an example snippet pulled from a `config.toml`: pre = "" weight = -100 url = "/getting-started/" -{{< /code >}} - -Here's the equivalent snippet in a `config.yaml`: - -{{< code file="config.yml" >}} -menu: - main: - - name: "about hugo" - pre: "" - weight: -110 - identifier: "about" - url: "/about/" - - name: "getting started" - pre: "" - weight: -100 - url: "/getting-started/" -{{< /code >}} +{{< /code-toggle >}} {{% note %}} The URLs must be relative to the context root. If the `baseURL` is `https://example.com/mysite/`, then the URLs in the menu must not include the context root `mysite`. Using an absolute URL will override the baseURL. If the value used for `URL` in the above example is `https://subdomain.example.com/`, the output will be `https://subdomain.example.com`. diff --git a/docs/content/content-management/multilingual.md b/docs/content/content-management/multilingual.md index d27195a9a..28a6e4fec 100644 --- a/docs/content/content-management/multilingual.md +++ b/docs/content/content-management/multilingual.md @@ -21,9 +21,9 @@ You should define the available languages in a `languages` section in your site ## Configure Languages -The following is an example of a TOML site configuration for a multilingual Hugo project: +The following is an example of a site configuration for a multilingual Hugo project: -{{< code file="config.toml" download="config.toml" >}} +{{< code-toggle file="config" >}} DefaultContentLanguage = "en" copyright = "Everything is mine" @@ -45,7 +45,7 @@ weight = 2 linkedin = "lien-francais" [languages.fr.params.navigation] help = "Aide" -{{< /code >}} +{{< /code-toggle >}} Anything not defined in a `[languages]` block will fall back to the global value for that key (e.g., `copyright` for the English [`en`] language). @@ -92,7 +92,7 @@ This means that you can now configure a `baseURL` per `language`: Example: -```bash +{{< code-toggle file="config" >}} [languages] [languages.no] baseURL = "https://example.no" @@ -105,7 +105,7 @@ baseURL = "https://example.com" languageName = "English" weight = 2 title = "In English" -``` +{{}} With the above, the two sites will be generated into `public` with their own root: @@ -132,7 +132,7 @@ Live reload and `--navigateToChanged` between the servers work as expected. Taxonomies and [Blackfriday configuration][config] can also be set per language: -{{< code file="bf-config.toml" >}} +{{< code-toggle file="config" >}} [Taxonomies] tag = "tags" @@ -152,7 +152,7 @@ weight = 2 title = "Français" [languages.fr.Taxonomies] plaque = "plaques" -{{< /code >}} +{{}} ## Translate Your Content diff --git a/docs/content/content-management/page-bundles.md b/docs/content/content-management/page-bundles.md index 09aeae8ea..34620a5e2 100644 --- a/docs/content/content-management/page-bundles.md +++ b/docs/content/content-management/page-bundles.md @@ -93,7 +93,7 @@ anywhere: But you can get it by `.Site.GetPage`. Here is an example: -```html +```go-html-template {{ $headless := .Site.GetPage "page" "some-headless-bundle" }} {{ $reusablePages := $headless.Resources.Match "author*" }}

    Authors

    diff --git a/docs/content/content-management/page-resources.md b/docs/content/content-management/page-resources.md index f3b12d8c4..cefb1cd47 100644 --- a/docs/content/content-management/page-resources.md +++ b/docs/content/content-management/page-resources.md @@ -83,9 +83,9 @@ params : A map of custom key/values. -### Resources metadata: YAML Example +### Resources metadata example -~~~yaml +{{< code-toggle copy="false">}} title: Application date : 2018-01-25 resources : @@ -108,41 +108,7 @@ resources : - src : "**.docx" params : icon : "word" -~~~ - -### Resources metadata: TOML Example - -~~~toml -title = Application -date : 2018-01-25 -[[resources]] - src = "images/sunset.jpg" - name = "header" -[[resources]] - src = "documents/photo_specs.pdf" - title = "Photo Specifications" - [resources.params] - icon = "photo" -[[resources]] - src = "documents/guide.pdf" - title = "Instruction Guide" -[[resources]] - src = "documents/checklist.pdf" - title = "Document Checklist" -[[resources]] - src = "documents/payment.docx" - title = "Proof of Payment" -[[resources]] - src = "**.pdf" - name = "pdf-file-:counter" - [resources.params] - icon = "pdf" -[[resources]] - src = "**.docx" - [resources.params] - icon = "word" -~~~ - +{{}} From the example above: @@ -165,14 +131,14 @@ The counter starts at 1 the first time they are used in either `name` or `title` For example, if a bundle has the resources `photo_specs.pdf`, `other_specs.pdf`, `guide.pdf` and `checklist.pdf`, and the front matter has specified the `resources` as: -~~~toml +{{< code-toggle copy="false">}} [[resources]] src = "*specs.pdf" title = "Specification #:counter" [[resources]] src = "**.pdf" name = "pdf-file-:counter" -~~~ +{{}} the `Name` and `Title` will be assigned to the resource files as follows: diff --git a/docs/content/content-management/related.md b/docs/content/content-management/related.md index 8ae6e79ce..6f66e4468 100644 --- a/docs/content/content-management/related.md +++ b/docs/content/content-management/related.md @@ -34,6 +34,11 @@ To list up to 5 related pages is as simple as including something similar to thi {{ end }} {{< /code >}} + +{{% note %}} +Read [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation more advanced usage of this feature. +{{% /note %}} + The full set of methods available on the page lists can bee seen in this Go interface: ```go diff --git a/docs/content/content-management/static-files.md b/docs/content/content-management/static-files.md index 12d27ccf2..fe5ea77e0 100644 --- a/docs/content/content-management/static-files.md +++ b/docs/content/content-management/static-files.md @@ -15,11 +15,11 @@ toc: true The `static` folder is where you place all your **static files**, e.g. stylesheets, JavaScript, images etc. -You can set the name of the static folder to use in your configuration file, for example `config.toml`. From **Hugo 0.31** you can configure as many static directories as you need. All the files in all the static directories will form a union filesystem. +You can set the name of the static folder to use in your configuration file. From **Hugo 0.31** you can configure as many static directories as you need. All the files in all the static directories will form a union filesystem. Example: -```toml +{{< code-toggle copy="false" file="config" >}} staticDir = ["static1", "static2"] [languages] [languages.no] @@ -35,7 +35,7 @@ baseURL = "https://example.com" languageName = "English" weight = 2 title = "In English" -``` +{{}} In the above, with no theme used: diff --git a/docs/content/content-management/syntax-highlighting.md b/docs/content/content-management/syntax-highlighting.md index 67d443fd4..e7eb011c8 100644 --- a/docs/content/content-management/syntax-highlighting.md +++ b/docs/content/content-management/syntax-highlighting.md @@ -147,7 +147,7 @@ See [Highlight](/functions/highlight/). It is also possible to add syntax highlighting with GitHub flavored code fences. To enable this, set the `pygmentsCodeFences` to `true` in Hugo's [configuration file](/getting-started/configuration/); ```` -```html +```go-html-template

    {{ .Title }}

    @@ -159,6 +159,11 @@ It is also possible to add syntax highlighting with GitHub flavored code fences. ``` ```` +## List of Chroma Highlighting Languages + +The full list of Chroma lexers and their aliases (which is the identifier used in the `hightlight` template func or when doing highlighting in code fences): + +{{< chroma-lexers >}} ## Highlight with Pygments Classic diff --git a/docs/content/content-management/taxonomies.md b/docs/content/content-management/taxonomies.md index 1a59ebe3e..287c6f899 100644 --- a/docs/content/content-management/taxonomies.md +++ b/docs/content/content-management/taxonomies.md @@ -103,23 +103,14 @@ When taxonomies are used---and [taxonomy templates][] are provided---Hugo will a Taxonomies must be defined in your [website configuration][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML. -### Example: TOML Taxonomy Configuration +### Example: Taxonomy Configuration -``` +{{< code-toggle copy="false" >}} [taxonomies] tag = "tags" category = "categories" series = "series" -``` - -### Example: YAML Taxonomy Configuration - -``` -taxonomies: - tag: "tags" - category: "categories" - series: "series" -``` +{{}} ### Preserve Taxonomy Values @@ -145,53 +136,16 @@ Assigning content to a taxonomy is done in the [front matter][]. Simply create a If you would like the ability to quickly generate content files with preconfigured taxonomies or terms, read the docs on [Hugo archetypes](/content-management/archetypes/). {{% /note %}} -### Example: TOML Front Matter with Taxonomies +### Example: Front Matter with Taxonomies -``` -+++ +{{< code-toggle copy="false">}} title = "Hugo: A fast and flexible static site generator" tags = [ "Development", "Go", "fast", "Blogging" ] categories = [ "Development" ] series = [ "Go Web Dev" ] slug = "hugo" project_url = "https://github.com/gohugoio/hugo" -+++ -``` - -### Example: YAML Front Matter with Taxonomies - -``` ---- -title: "Hugo: A fast and flexible static site generator" -tags: ["Development", "Go", "fast", "Blogging"] -categories: ["Development"] -series: ["Go Web Dev"] -slug: "hugo" -project_url: "https://github.com/gohugoio/hugo" ---- -``` - -### Example: JSON Front Matter with Taxonomies - -``` -{ - "title": "Hugo: A fast and flexible static site generator", - "tags": [ - "Development", - "Go", - "fast", - "Blogging" - ], - "categories" : [ - "Development" - ], - "series" : [ - "Go Web Dev" - ], - "slug": "hugo", - "project_url": "https://github.com/gohugoio/hugo" -} -``` +{{}} ## Order Taxonomies @@ -199,29 +153,15 @@ A content file can assign weight for each of its associate taxonomies. Taxonomic The following TOML and YAML examples show a piece of content that has a weight of 22, which can be used for ordering purposes when rendering the pages assigned to the "a", "b" and "c" values of the `tags` taxonomy. It has also been assigned the weight of 44 when rendering the "d" category page. -### Example: TOML Taxonomic `weight` +### Example: Taxonomic `weight` -``` -+++ +{{< code-toggle copy="false" >}} title = "foo" tags = [ "a", "b", "c" ] tags_weight = 22 categories = ["d"] categories_weight = 44 -+++ -``` - -### Example: YAML Taxonomic `weight` - -``` ---- -title: foo -tags: [ "a", "b", "c" ] -tags_weight: 22 -categories: ["d"] -categories_weight: 44 ---- -``` +{{}} By using taxonomic weight, the same piece of content can appear in different positions in different taxonomies. diff --git a/docs/content/content-management/urls.md b/docs/content/content-management/urls.md index dd91fbced..d33725b72 100644 --- a/docs/content/content-management/urls.md +++ b/docs/content/content-management/urls.md @@ -29,19 +29,12 @@ These examples use the default values for `publishDir` and `contentDir`; i.e., ` For example, if one of your [sections][] is called `post` and you want to adjust the canonical path to be hierarchical based on the year, month, and post title, you could set up the following configurations in YAML and TOML, respectively. -### YAML Permalinks Configuration Example +### Permalinks Configuration Example -{{< code file="config.yml" copy="false" >}} +{{< code-toggle file="config" copy="false" >}} permalinks: post: /:year/:month/:title/ -{{< /code >}} - -### TOML Permalinks Configuration Example - -{{< code file="config.toml" copy="false" >}} -[permalinks] - post = "/:year/:month/:title/" -{{< /code >}} +{{< /code-toggle >}} Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `https://example.com/2017/02/sample-entry/`. diff --git a/docs/content/functions/where.md b/docs/content/functions/where.md index 3aa03296b..eb3111215 100644 --- a/docs/content/functions/where.md +++ b/docs/content/functions/where.md @@ -22,7 +22,7 @@ needsexample: true `where` filters an array to only the elements containing a matching value for a given field. -``` +```go-html-template {{ range where .Data.Pages "Section" "post" }} {{ .Content }} {{ end }} @@ -36,7 +36,7 @@ series: golang +++ ``` -``` +```go-html-template {{ range where .Site.Pages "Params.series" "golang" }} {{ .Content }} {{ end }} @@ -44,7 +44,7 @@ series: golang 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 .Data.Pages "Section" "!=" "post" }} {{ .Content }} {{ end }} @@ -81,7 +81,7 @@ The following logical operators are available with `where`: ## Use `where` with `intersect` -``` +```go-html-template {{ range where .Site.Pages ".Params.tags" "intersect" .Params.tags }} {{ if ne .Permalink $.Permalink }} {{ .Render "summary" }} @@ -113,7 +113,7 @@ The following grabs the first five content files in `post` using the [default or 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 .Data.Pages "Section" "blog" ) ".Params.featured" "!=" "true" }} ``` @@ -128,7 +128,7 @@ 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 .Data.Pages ".Params.specialpost" "!=" nil }} {{ .Content }} {{ end }} @@ -140,7 +140,7 @@ This is especially important for themes, but to list the most relevant pages on This will, by default, list pages from the _section with the most pages_. -```html +```go-html-template {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} ``` diff --git a/docs/content/getting-started/code-toggle.md b/docs/content/getting-started/code-toggle.md index ae3e3e84b..3e6b7da0d 100644 --- a/docs/content/getting-started/code-toggle.md +++ b/docs/content/getting-started/code-toggle.md @@ -15,7 +15,7 @@ toc: true This is an exemple for the Config Toggle shortcode. Its purpose is to let users choose a Config language by clicking on its corresponding tab. Upon doing so, every Code toggler on the page will be switched to the target language. Also, target language will be saved in user's `localStorage` so when they go to a different pages, Code Toggler display their last "toggled" config language. -## That Congig Toggler +## That Config Toggler {{< code-toggle file="config">}} @@ -72,4 +72,4 @@ blackfriday: plainIDAnchors: true extensions: - hardLineBreak -{{< /code >}} \ No newline at end of file +{{< /code >}} diff --git a/docs/content/getting-started/configuration.md b/docs/content/getting-started/configuration.md index ba2c87e82..8da25fd58 100644 --- a/docs/content/getting-started/configuration.md +++ b/docs/content/getting-started/configuration.md @@ -250,9 +250,11 @@ Similar to the template [lookup order][], Hugo has a default set of rules for se 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. -## YAML Configuration +## Example Configuration -{{< code file="config.yml">}} +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: "↩" @@ -266,49 +268,7 @@ params: - "foo1" - "foo2" SidebarRecentLimit: 5 -{{< /code >}} - -The following is a typical example of a YAML configuration file. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]: - -{{< code file="config.yml">}} -baseURL: "https://yoursite.example.com/" -title: "My Hugo Site" -footnoteReturnLinkContents: "↩" -permalinks: - post: /:year/:month/:title/ -params: - Subtitle: "Hugo is Absurdly Fast!" - AuthorName: "Jon Doe" - GitHubUser: "spf13" - ListOfFoo: - - "foo1" - - "foo2" - SidebarRecentLimit: 5 -{{< /code >}} - -## TOML Configuration - -The following is an example of a TOML configuration file. The values under `[params]` will populate the `.Site.Params` variable for use in [templates][]: - -{{< code file="config.toml">}} -contentDir = "content" -layoutDir = "layouts" -publishDir = "public" -buildDrafts = false -baseURL = "https://yoursite.example.com/" -canonifyURLs = true -title = "My Hugo Site" - -[taxonomies] - category = "categories" - tag = "tags" - -[params] - subtitle = "Hugo is Absurdly Fast!" - author = "John Doe" -{{< /code >}} - - +{{< /code-toggle >}} ## Configure with Environment Variables @@ -416,22 +376,13 @@ However, if you have specific needs with respect to Markdown, Hugo exposes some 2. Blackfriday flags must be grouped under the `blackfriday` key and can be set on both the site level *and* the page level. Any setting on a page will override its respective site setting. {{% /note %}} -{{< code file="bf-config.toml" >}} +{{< code-toggle file="config" >}} [blackfriday] angledQuotes = true fractions = false plainIDAnchors = true extensions = ["hardLineBreak"] -{{< /code >}} - -{{< code file="bf-config.yml" >}} -blackfriday: - angledQuotes: true - fractions: false - plainIDAnchors: true - extensions: - - hardLineBreak -{{< /code >}} +{{< /code-toggle >}} ## Configure Additional Output Formats diff --git a/docs/content/news/0.27-relnotes-ready.md b/docs/content/news/0.27-relnotes-ready.md index 3dd02d455..9251c3768 100644 --- a/docs/content/news/0.27-relnotes-ready.md +++ b/docs/content/news/0.27-relnotes-ready.md @@ -9,7 +9,7 @@ categories: ["Releases"] Hugo `0.27`comes with fast and flexible **Related Content** ([3b4f17bb](https://github.com/gohugoio/hugo/commit/3b4f17bbc9ff789faa581ac278ad109d1ac5b816) [@bep](https://github.com/bep) [#98](https://github.com/gohugoio/hugo/issues/98)). To add this to your site, put something like this in your single page template: -```html +```go-html-template {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }}

    See Also

    diff --git a/docs/content/news/0.27-relnotes.md b/docs/content/news/0.27-relnotes.md index a4ead0816..92fc3a7b0 100644 --- a/docs/content/news/0.27-relnotes.md +++ b/docs/content/news/0.27-relnotes.md @@ -11,7 +11,7 @@ images: Hugo `0.27`comes with fast and flexible **Related Content** ([3b4f17bb](https://github.com/gohugoio/hugo/commit/3b4f17bbc9ff789faa581ac278ad109d1ac5b816) [@bep](https://github.com/bep) [#98](https://github.com/gohugoio/hugo/issues/98)). To add this to your site, put something like this in your single page template: -```html +```go-html-template {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }}

    See Also

    diff --git a/docs/content/news/0.35-relnotes/index.md b/docs/content/news/0.35-relnotes/index.md index 6ce614dfa..80b4afd7b 100644 --- a/docs/content/news/0.35-relnotes/index.md +++ b/docs/content/news/0.35-relnotes/index.md @@ -74,7 +74,7 @@ Hugo now has: * Only set `url` if permalink in metadata and remove duplicate confirm msg [3752348e](https://github.com/gohugoio/hugo/commit/3752348ef13ced8f6f528b42ee7d76a12a97ae5c) [@lildude](https://github.com/lildude) [#1887](https://github.com/gohugoio/hugo/issues/1887) * Start Resources :counter first time they're used [7b472e46](https://github.com/gohugoio/hugo/commit/7b472e46084b603045b87cea870ffc73ac1cf7e7) [@bep](https://github.com/bep) [#4335](https://github.com/gohugoio/hugo/issues/4335) * Update to Go 1.9.3 [a91aba1c](https://github.com/gohugoio/hugo/commit/a91aba1c1562259dffd321a608f38c38dd4d5aeb) [@bep](https://github.com/bep) [#4328](https://github.com/gohugoio/hugo/issues/4328) -* Support pages without front matter [91bb774a](https://github.com/gohugoio/hugo/commit/91bb774ae4e129f7ed0624754b31479c960ef774) [@vassudanagunta](https://github.com/vassudanagunta) [#4320](https://github.com/gohugoio/hugo/issues/4320)[#4320](https://github.com/gohugoio/hugo/issues/4320) +* Support pages without front matter [91bb774a](https://github.com/gohugoio/hugo/commit/91bb774ae4e129f7ed0624754b31479c960ef774) [@vassudanagunta](https://github.com/vassudanagunta) [#4320](https://github.com/gohugoio/hugo/issues/4320) * Add page metadata dates tests [3f0379ad](https://github.com/gohugoio/hugo/commit/3f0379adb72389954ca2be6a9f2ebfcd65c6c440) [@vassudanagunta](https://github.com/vassudanagunta) * Re-generate CLI docs [1e27d058](https://github.com/gohugoio/hugo/commit/1e27d0589118a114e49c032e4bd68b4798e44a5b) [@bep](https://github.com/bep) * Remove and update deprecation status [d418c2c2](https://github.com/gohugoio/hugo/commit/d418c2c2eacdc1dc6fffe839e0a90600867878ca) [@bep](https://github.com/bep) diff --git a/docs/content/news/0.38-relnotes/featured-poster.png b/docs/content/news/0.38-relnotes/featured-poster.png new file mode 100644 index 000000000..1e7988c8f Binary files /dev/null and b/docs/content/news/0.38-relnotes/featured-poster.png differ diff --git a/docs/content/news/0.38-relnotes/index.md b/docs/content/news/0.38-relnotes/index.md index 1bfa7e14c..88ef88872 100644 --- a/docs/content/news/0.38-relnotes/index.md +++ b/docs/content/news/0.38-relnotes/index.md @@ -1,16 +1,15 @@ --- date: 2018-04-02 -title: "0.38" -description: "0.38" +title: "The Easter Egg Edition" +description: "Hugo 0.38: Date and slug from filenames, multiple content dirs, config from themes, language merge func …" categories: ["Releases"] --- - - - Hugo `0.38` is an **Easter egg** filled with good stuff. We now support fetching **date and slug from the content filename**, making the move from Jekyll even easier. And you can now set `contentDir` per language with intelligent merging, and themes can now provide configuration ... Also worth mentioning is several improvements in the [Chroma](https://github.com/alecthomas/chroma) highlighter, most notable support for Go templates. +We are working hard to get the documentation up-to-date with the new features, but you can also see them in action with the full source at [hugotest.bep.is](http://hugotest.bep.is/). + This release represents **39 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 [@anthonyfok](https://github.com/anthonyfok), [@felicianotech](https://github.com/felicianotech), and [@paulcmal](https://github.com/paulcmal) for their ongoing contributions. diff --git a/docs/content/news/0.38.1-relnotes/index.md b/docs/content/news/0.38.1-relnotes/index.md index 73cdeb247..b900b6fb0 100644 --- a/docs/content/news/0.38.1-relnotes/index.md +++ b/docs/content/news/0.38.1-relnotes/index.md @@ -1,8 +1,8 @@ --- date: 2018-04-05 -title: "0.38.1" -description: "0.38.1" +title: "Some Live Reload Fixes" +description: "Hugo 0.38.1 fixes some live reload issues introduced in 0.38." categories: ["Releases"] images: - images/blog/hugo-bug-poster.png diff --git a/docs/content/news/0.38.2-relnotes/index.md b/docs/content/news/0.38.2-relnotes/index.md index 33cae7476..d69c5f5b3 100644 --- a/docs/content/news/0.38.2-relnotes/index.md +++ b/docs/content/news/0.38.2-relnotes/index.md @@ -1,8 +1,8 @@ --- date: 2018-04-09 -title: "0.38.2" -description: "0.38.2" +title: "Hugo 0.38.2: Two Bugfixes" +description: "0.38.2 fixes --contentDir flag handling and \".\" in content filenames." categories: ["Releases"] images: - images/blog/hugo-bug-poster.png diff --git a/docs/content/templates/data-templates.md b/docs/content/templates/data-templates.md index c0b2b5145..460a657ef 100644 --- a/docs/content/templates/data-templates.md +++ b/docs/content/templates/data-templates.md @@ -95,16 +95,16 @@ Discover a new favorite bass player? Just add another `.toml` file in the same d ## Example: Accessing Named Values in a Data File -Assume you have the following YAML structure in your `User0123.yml` data file located directly in `data/`: +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" -``` +{{}} You can use the following code to render the `Short Description` in your layout:: @@ -213,12 +213,16 @@ If you don't like caching at all, you can fully disable caching with the command 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 +## 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 [Calling the Functions with a URL](#calling-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//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. diff --git a/docs/content/templates/internal.md b/docs/content/templates/internal.md index 6f8d4e864..7fbfec43c 100644 --- a/docs/content/templates/internal.md +++ b/docs/content/templates/internal.md @@ -33,13 +33,9 @@ Hugo ships with internal templates for Google Analytics tracking, including both Provide your tracking id in your configuration file: -``` +{{< code-toggle file="config" >}} googleAnalytics = "UA-123-45" -``` - -``` -googleAnalytics: "UA-123-45" -``` +{{}} ### Use the Google Analytics Template @@ -62,13 +58,9 @@ Hugo also ships with an internal template for [Disqus comments][disqus], a popul To use Hugo's Disqus template, you first need to set a single value in your site's `config.toml` or `config.yml`: -``` +{{< code-toggle file="config" >}} disqusShortname = "yourdiscussshortname" -``` - -``` -disqusShortname: "yourdiscussshortname" -``` +{{}} You also have the option to set the following in the front matter for a given piece of content: diff --git a/docs/content/templates/introduction.md b/docs/content/templates/introduction.md index 95db7eab8..32df11297 100644 --- a/docs/content/templates/introduction.md +++ b/docs/content/templates/introduction.md @@ -458,7 +458,7 @@ You can arbitrarily define as many site-level parameters as you want in your [si For instance, you might declare the following: -{{< code file="config.yaml" >}} +{{< code-toggle file="config" >}} params: copyrighthtml: "Copyright © 2017 John Doe. All Rights Reserved." twitteruser: "spf13" diff --git a/docs/content/templates/menu-templates.md b/docs/content/templates/menu-templates.md index 9eba3dc1b..5efb080d8 100644 --- a/docs/content/templates/menu-templates.md +++ b/docs/content/templates/menu-templates.md @@ -28,34 +28,39 @@ The following is an example: {{< code file="layouts/partials/sidebar.html" download="sidebar.html" >}} {{< /code >}} @@ -89,16 +94,16 @@ In the above, the menu item is marked as active if on the current section's list ## Site Config menus -The above is all that's needed. But if you want custom menu items, e.g. changing weight, name, or link title attribute, you can define them manually in the site config, i.e. `config.toml`: +The above is all that's needed. But if you want custom menu items, e.g. changing weight, name, or link title attribute, you can define them manually in the site config file: -``` +{{< code-toggle file="config" >}} [[menu.main]] name = "This is the blog section" title = "blog section" weight = -110 identifier = "blog" url = "/blog/" -``` +{{}} {{% note %}} The `identifier` *must* match the section name. diff --git a/docs/content/templates/output-formats.md b/docs/content/templates/output-formats.md index 9af68f5e0..ff286c9d2 100644 --- a/docs/content/templates/output-formats.md +++ b/docs/content/templates/output-formats.md @@ -1,7 +1,7 @@ --- 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. +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: 2017-03-22 @@ -37,13 +37,13 @@ This is the full set of built-in media types in Hugo: 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"] suffix = "enr" [mediaTypes."text/html"] suffix = "asp" -``` +{{}} The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type. @@ -60,11 +60,11 @@ suffix = "htm" mediaType = "text/html" ``` -**Note** that for the above to work, you also need to add an`outputs` definition in your site config. +**Note** that for the above to work, you also need to add an `outputs` definition in your site config. -## Output Formats +## Output Format Definitions -Given a media type and some additional configuration, you get an `Output Format`: +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: @@ -76,13 +76,13 @@ This is the full set of Hugo's built-in output formats: 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://" -``` +{{}} 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`. @@ -122,32 +122,44 @@ The following is the full list of configuration options for output formats and t ## Output Formats for Pages -A `Page` in Hugo can be rendered to multiple representations on the file system. By default, all pages will render as `HTML` with some of them also as `RSS` (homepage, sections, etc.). +A `Page` in Hugo can be rendered to multiple *output formats* on the file +system. -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). +### Default Output Formats +Every `Page` has a [`Kind`][page_kinds] attribute, and the default Output +Formats are set based on that. -Example from site `config.toml`: +| Kind | Default Output Formats | +|--------------- |----------------------- | +| `page` | HTML | +| `home` | HTML, RSS | +| `section` | HTML, RSS | +| `taxonomyTerm` | HTML, RSS | +| `taxonomy` | 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"] -``` - -Example from site `config.yml`: - -``` -outputs: - home: ["HTML", "AMP", "RSS"] - page: ["HTML"] -``` +{{}} -* The output definition is per `Page` `Kind` (i.e, `page`, `home`, `section`, `taxonomy`, or `taxonomyTerm`). -* The names used must match the `Name` of a defined `Output Format`. -* Any `Kind` without a definition will default to `HTML`. +Note that in the above examples, the *output formats* for `section`, +`taxonomyTerm` and `taxonomy` will stay at their default value `["HTML", +"RSS"]`. + +* The `outputs` definition is per [`Page` `Kind`][page_kinds] (`page`, `home`, `section`, `taxonomy`, or `taxonomyTerm`). +* 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. -* Output formats are case insensitive. The following is an example of `YAML` front matter in a content file that defines output formats for the rendered `Page`: @@ -165,7 +177,7 @@ outputs: 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 ``: -```html +```go-html-template {{ range .AlternativeOutputFormats -}} {{ end -}} @@ -175,7 +187,7 @@ Note that `.Permalink` and `.RelPermalink` on `Page` will return the first outpu This is how you link to a given output format: -```html +```go-html-template {{ with .OutputFormats.Get "json" -}} {{ .Name }} {{- end }} @@ -183,7 +195,7 @@ This is how you link to a given output format: From content files, you can use the [`ref` or `relref` shortcodes](/content-management/shortcodes/#ref-and-relref): -```html +```go-html-template [Neat]({{}}) [Who]({{}}) ``` @@ -222,3 +234,4 @@ The partial below is a plain text template (Outpuf Format is `CSV`, and since th [lookup order]: /templates/lookup/ [media type]: https://en.wikipedia.org/wiki/Media_type [partials]: /templates/partials/ +[page_kinds]: /templates/section-templates/#page-kinds diff --git a/docs/content/templates/sitemap-template.md b/docs/content/templates/sitemap-template.md index 98a4c2b1d..29b59ad12 100644 --- a/docs/content/templates/sitemap-template.md +++ b/docs/content/templates/sitemap-template.md @@ -63,12 +63,12 @@ on render. Please don't include this in the template as it's not valid HTML. Defaults for ``, `` and `filename` values can be set in the site's config file, e.g.: -``` +{{< code-toggle file="config" >}} [sitemap] changefreq = "monthly" priority = 0.5 filename = "sitemap.xml" -``` +{{}} The same fields can be specified in an individual content file's front matter in order to override the value assigned to that piece of content at render time. diff --git a/docs/content/tools/search.md b/docs/content/tools/search.md index 149bdfe05..2145c187c 100644 --- a/docs/content/tools/search.md +++ b/docs/content/tools/search.md @@ -24,6 +24,7 @@ A static website with a dynamic search function? Yes. As alternatives to embedda * [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). A simple way to add site search to your static Hugo site using [lunr.js](http://lunrjs.com/). Hugo-lunr will create an index file of any html and markdown documents in your Hugo project. * [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords. * [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](http://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo! +* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files. ## Commercial Search Services diff --git a/docs/content/variables/site.md b/docs/content/variables/site.md index f0c041ecb..a5909a563 100644 --- a/docs/content/variables/site.md +++ b/docs/content/variables/site.md @@ -109,15 +109,15 @@ The following is a list of site-level (aka "global") variables. Many of these va ### Example: `.Site.Params` -The following `config.toml` defines a site-wide param for `description`: +The following `config.[yaml|toml|json]` defines a site-wide param for `description`: -``` +{{< code-toggle file="config" >}} baseURL = "https://yoursite.example.com/" [params] description = "Tesla's Awesome Hugo Site" author = "Nikola Tesla" -``` +{{}} You can use `.Site.Params` in a [partial template](/templates/partials/) to call the default site description: diff --git a/docs/layouts/shortcodes/chroma-lexers.html b/docs/layouts/shortcodes/chroma-lexers.html new file mode 100644 index 000000000..0df2b868f --- /dev/null +++ b/docs/layouts/shortcodes/chroma-lexers.html @@ -0,0 +1,6 @@ +
    +{{ range .Site.Data.docs.chroma.lexers }} +
    {{ .Name }}
    +
    {{ delimit .Aliases ", " }}
    +{{ end }} +
    \ No newline at end of file diff --git a/docs/layouts/shortcodes/code.html b/docs/layouts/shortcodes/code.html index 83220c47d..2ee20b1eb 100644 --- a/docs/layouts/shortcodes/code.html +++ b/docs/layouts/shortcodes/code.html @@ -5,6 +5,9 @@ {{ $.Scratch.Set "codeLang" (index . 0 | strings.TrimPrefix ".") }} {{ end }} {{ with .Get "codeLang" }}{{ $.Scratch.Set "codeLang" . }}{{ end }} +{{ if eq (.Scratch.Get "codeLang") "html"}} +{{ $.Scratch.Set "codeLang" "go-html-template" }} +{{ end }}
    {{- with $file -}}
    {{.}}
    diff --git a/docs/netlify.toml b/docs/netlify.toml index 5955d26cd..0f24d5ae3 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo" [context.production.environment] -HUGO_VERSION = "0.37.1" +HUGO_VERSION = "0.38.2" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.37.1" +HUGO_VERSION = "0.38.2" HUGO_ENV = "production" [context.deploy-preview] command = "hugo -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.37.1" +HUGO_VERSION = "0.38.2" [context.branch-deploy] command = "hugo -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.37.1" +HUGO_VERSION = "0.38.2" [context.next.environment] HUGO_ENABLEGITINFO = "true" diff --git a/docs/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_480x0_resize_catmullrom_2.png b/docs/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_480x0_resize_catmullrom_2.png new file mode 100644 index 000000000..ec2bf453c Binary files /dev/null and b/docs/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_480x0_resize_catmullrom_2.png differ diff --git a/docs/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_640x0_resize_catmullrom_2.png b/docs/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_640x0_resize_catmullrom_2.png new file mode 100644 index 000000000..b97d27f32 Binary files /dev/null and b/docs/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_640x0_resize_catmullrom_2.png differ diff --git a/docs/themes/gohugoioTheme/data/sponsors.toml b/docs/themes/gohugoioTheme/data/sponsors.toml index 5e35a25dc..eb9964f39 100644 --- a/docs/themes/gohugoioTheme/data/sponsors.toml +++ b/docs/themes/gohugoioTheme/data/sponsors.toml @@ -11,7 +11,7 @@ logo = "/images/sponsors/linode-logo_standard_light_medium.png" copy = "" [[banners]] -name = "" -link = "" -logo = "" +name = "eSolia" +link = "https://esolia.com/" +logo = "/images/sponsors/esolia-logo.svg" copy = "" \ No newline at end of file diff --git a/docs/themes/gohugoioTheme/src/css/_tabs.css b/docs/themes/gohugoioTheme/src/css/_tabs.css index 4ed15b63d..6e0022cc9 100644 --- a/docs/themes/gohugoioTheme/src/css/_tabs.css +++ b/docs/themes/gohugoioTheme/src/css/_tabs.css @@ -7,13 +7,17 @@ outline: none; background-color:white; } +.tab-pane code{ + background:#f1f2f2; + border-radius:0; +} .tab-pane .chroma{ background:none; padding:0; } .tab-button.active{ - border-bottom-color:#f3f4f4; - background-color: #f4f4f4; + border-bottom-color:#f1f2f2; + background-color: #f1f2f2; } .tab-content .tab-pane{ display: none; diff --git a/docs/themes/gohugoioTheme/static/dist/app.bundle.js b/docs/themes/gohugoioTheme/static/dist/app.bundle.js index 6391e71e9..7ea75e36f 100644 --- a/docs/themes/gohugoioTheme/static/dist/app.bundle.js +++ b/docs/themes/gohugoioTheme/static/dist/app.bundle.js @@ -1,22 +1,11890 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,n){"use strict";var r=function(t){var e=document.createElement("a");return e.className="header-link",e.href="#"+t,e.innerHTML=' ',e},i=function(t,e){for(var n=e.getElementsByTagName("h"+t),i=0;i0&&p.parentNode.classList.add("expand")}}catch(t){a=!0,u=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw u}}}},function(t,e,n){"use strict";n(13)({apiKey:"167e7998590aebda7f9fedcf86bc4a55",indexName:"hugodocs",inputSelector:"#search-input",debug:!0})},function(t,e,n){"use strict";n(14),n(15)},function(t,e,n){"use strict";function r(){for(var t=this.dataset.target.split(" "),e=document.querySelector(".mobilemenu:not(.dn)"),n=document.querySelector(".desktopmenu:not(.dn)"),r=document.querySelector(".desktopmenu:not(.dn)"),i=0;i=0?function(){var t=window.pageYOffset;(t>=i-s||window.innerHeight+t>=document.body.offsetHeight)&&clearInterval(u)}:function(){window.pageYOffset<=(i||0)&&clearInterval(u)};var u=setInterval(a,16)},e=document.querySelectorAll("#TableOfContents ul li a");[].forEach.call(e,function(e){e.addEventListener("click",function(n){n.preventDefault();var r=e.getAttribute("href"),i=document.querySelector(r),o=e.getAttribute("data-speed");i&&t(i,o||500)},!1)})}}()},function(t,e,n){"use strict";function r(t){if(t.target){t.preventDefault();var e=t.currentTarget,n=e.getAttribute("data-toggle-tab")}else var n=t;window.localStorage&&window.localStorage.setItem("configLangPref",n);for(var r=document.querySelectorAll("[data-toggle-tab='"+n+"']"),i=document.querySelectorAll("[data-pane='"+n+"']"),a=0;a 0) codeBlock.parentNode.classList.add('expand'); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } +} + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var docsearch = __webpack_require__(13); +docsearch({ + apiKey: '167e7998590aebda7f9fedcf86bc4a55', + indexName: 'hugodocs', + inputSelector: '#search-input', + debug: true // Set debug to true if you want to inspect the dropdown +}); + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var lazysizes = __webpack_require__(14); +// var lsnoscript = require('lazysizes/plugins/noscript/ls.noscript.js'); +var unveilhooks = __webpack_require__(15); + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Grab any element that has the 'js-toggle' class and add an event listner for the toggleClass function +var toggleBtns = document.getElementsByClassName('js-toggle'); +for (var i = 0; i < toggleBtns.length; i++) { + toggleBtns[i].addEventListener('click', toggleClass, false); +} + +function toggleClass() { + // Define the data target via the dataset "target" (e.g. data-target=".docsmenu") + var content = this.dataset.target.split(' '); + // Find any menu items that are open + var mobileCurrentlyOpen = document.querySelector('.mobilemenu:not(.dn)'); + var desktopCurrentlyOpen = document.querySelector('.desktopmenu:not(.dn)'); + var desktopActive = document.querySelector('.desktopmenu:not(.dn)'); + + // Loop through the targets' divs + for (var i = 0; i < content.length; i++) { + var matches = document.querySelectorAll(content[i]); + //for each, if the div has the 'dn' class (which is "display:none;"), remove it, otherwise, add that class + [].forEach.call(matches, function (dom) { + dom.classList.contains('dn') ? dom.classList.remove('dn') : dom.classList.add('dn'); + return false; + }); + // close the currently open menu items + if (mobileCurrentlyOpen) mobileCurrentlyOpen.classList.add('dn'); + if (desktopCurrentlyOpen) desktopCurrentlyOpen.classList.add('dn'); + if (desktopActive) desktopActive.classList.remove('db'); + } +} + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, 'js'); + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var scrollDir = __webpack_require__(16); + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// query selector targets Hugo TOC +(function () { + + 'use strict'; + + // Feature Test + + if ('querySelector' in document && 'addEventListener' in window && Array.prototype.forEach) { + + // Function to animate the scroll + var smoothScroll = function smoothScroll(anchor, duration) { + + // Calculate how far and how fast to scroll + var startLocation = window.pageYOffset; + var endLocation = anchor.offsetTop; + var distance = endLocation - startLocation; + var increments = distance / (duration / 16); + var stopAnimation; + + // Scroll the page by an increment, and check if it's time to stop + var animateScroll = function animateScroll() { + window.scrollBy(0, increments); + stopAnimation(); + }; + + // If scrolling down + if (increments >= 0) { + // Stop animation when you reach the anchor OR the bottom of the page + stopAnimation = function stopAnimation() { + var travelled = window.pageYOffset; + if (travelled >= endLocation - increments || window.innerHeight + travelled >= document.body.offsetHeight) { + clearInterval(runAnimation); + } + }; + } + // If scrolling up + else { + // Stop animation when you reach the anchor OR the top of the page + stopAnimation = function stopAnimation() { + var travelled = window.pageYOffset; + if (travelled <= (endLocation || 0)) { + clearInterval(runAnimation); + } + }; + } + + // Loop the animation function + var runAnimation = setInterval(animateScroll, 16); + }; + + // Define smooth scroll links + var scrollToggle = document.querySelectorAll('#TableOfContents ul li a'); + + // For each smooth scroll link + [].forEach.call(scrollToggle, function (toggle) { + + // When the smooth scroll link is clicked + toggle.addEventListener('click', function (e) { + + // Prevent the default link behavior + e.preventDefault(); + + // Get anchor link and calculate distance from the top + var dataID = toggle.getAttribute('href'); + var dataTarget = document.querySelector(dataID); + var dataSpeed = toggle.getAttribute('data-speed'); + + // If the anchor exists + if (dataTarget) { + // Scroll to the anchor + smoothScroll(dataTarget, dataSpeed || 500); + } + }, false); + }); + } +})(); + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Scripts which manages Code Toggle tabs. + */ +var i; +// store tabs variable +var allTabs = document.querySelectorAll("[data-toggle-tab]"); +var allPanes = document.querySelectorAll("[data-pane]"); + +function toggleTabs(event) { + + if (event.target) { + event.preventDefault(); + var clickedTab = event.currentTarget; + var targetKey = clickedTab.getAttribute("data-toggle-tab"); + } else { + var targetKey = event; + } + // We store the config language selected in users' localStorage + if (window.localStorage) { + window.localStorage.setItem("configLangPref", targetKey); + } + var selectedTabs = document.querySelectorAll("[data-toggle-tab='" + targetKey + "']"); + var selectedPanes = document.querySelectorAll("[data-pane='" + targetKey + "']"); + + for (var i = 0; i < allTabs.length; i++) { + allTabs[i].classList.remove("active"); + allPanes[i].classList.remove("active"); + } + + for (var i = 0; i < selectedTabs.length; i++) { + selectedTabs[i].classList.add("active"); + selectedPanes[i].classList.add("active"); + } +} + +for (i = 0; i < allTabs.length; i++) { + allTabs[i].addEventListener("click", toggleTabs); +} +// Upon page load, if user has a prefered language in its localStorage, tabs are set to it. +if (window.localStorage.getItem('configLangPref')) { + toggleTabs(window.localStorage.getItem('configLangPref')); +} + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _main = __webpack_require__(10); + +var _main2 = _interopRequireDefault(_main); + +__webpack_require__(0); + +__webpack_require__(1); + +__webpack_require__(2); + +__webpack_require__(3); + +__webpack_require__(4); + +__webpack_require__(5); + +__webpack_require__(7); + +__webpack_require__(8); + +__webpack_require__(9); + +__webpack_require__(6); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +var require;var require;/*! * clipboard.js v1.7.1 * https://zenorocha.github.io/clipboard.js * * Licensed MIT © Zeno Rocha */ -!function(e){t.exports=e()}(function(){var t;return function t(e,n,i){function o(a,u){if(!n[a]){if(!e[a]){var c="function"==typeof r&&r;if(!u&&c)return r(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[a]={exports:{}};e[a][0].call(h.exports,function(t){var n=e[a][1][t];return o(n||t)},h,h.exports,t,e,n,i)}return n[a].exports}for(var s="function"==typeof r&&r,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=s})},{select:5}],8:[function(e,n,r){!function(i,o){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],o);else if(void 0!==r)o(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var s={exports:{}};o(s,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=s.exports}}(this,function(t,e,n,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var c=i(e),l=i(n),h=i(r),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===f(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,h.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new c.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(l.default);t.exports=d})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)})},function(t,e,n){/*! docsearch 2.4.1 | © Algolia | github.com/algolia/docsearch */ -!function(e,n){t.exports=n()}(0,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=46)}([function(t,e,n){"use strict";function r(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var i=n(1);t.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(t){return"number"==typeof t},toStr:function(t){return void 0===t||null===t?"":t+""},cloneDeep:function(t){var e=this.mixin({},t),n=this;return this.each(e,function(t,r){t&&(n.isArray(t)?e[r]=[].concat(t):n.isObject(t)&&(e[r]=n.cloneDeep(t)))}),e},error:function(t){throw new Error(t)},every:function(t,e){var n=!0;return t?(this.each(t,function(r,i){if(!(n=e.call(null,r,i,t)))return!1}),!!n):n},any:function(t,e){var n=!1;return t?(this.each(t,function(r,i){if(e.call(null,r,i,t))return n=!0,!1}),n):n},getUniqueId:function(){var t=0;return function(){return t++}}(),templatify:function(t){if(this.isFunction(t))return t;var e=i.element(t);return"SCRIPT"===e.prop("tagName")?function(){return e.text()}:function(){return String(t)}},defer:function(t){setTimeout(t,0)},noop:function(){},formatPrefix:function(t,e){return e?"":t+"-"},className:function(t,e,n){return(n?"":".")+t+e},escapeHighlightedString:function(t,e,n){e=e||"";var i=document.createElement("div");i.appendChild(document.createTextNode(e)),n=n||"";var o=document.createElement("div");o.appendChild(document.createTextNode(n));var s=document.createElement("div");return s.appendChild(document.createTextNode(t)),s.innerHTML.replace(RegExp(r(i.innerHTML),"g"),e).replace(RegExp(r(o.innerHTML),"g"),n)}}},function(t,e,n){"use strict";t.exports={element:null}},function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,e,i){if("[object Function]"!==r.call(e))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s was loaded but did not call our provided callback"),JSONPScriptError:i("JSONPScriptError","