diff --git a/config.toml b/config.toml index 653e61f7b..25cc01a0d 100644 --- a/config.toml +++ b/config.toml @@ -70,7 +70,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.37.1" + release = "0.38.1" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff --git a/content/about/new-in-032/index.md b/content/about/new-in-032/index.md index 41bd58937..b8ca6430e 100644 --- a/content/about/new-in-032/index.md +++ b/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/content/content-management/comments.md b/content/content-management/comments.md index 355bf0042..20932a825 100644 --- a/content/content-management/comments.md +++ b/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/content/content-management/front-matter.md b/content/content-management/front-matter.md index a6a3f2403..2fc18ee31 100644 --- a/content/content-management/front-matter.md +++ b/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/content/content-management/image-processing/index.md b/content/content-management/image-processing/index.md index 1f84ba04d..ecc85bb51 100644 --- a/content/content-management/image-processing/index.md +++ b/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/content/content-management/menus.md b/content/content-management/menus.md index 1353ce0e2..c2eadf50f 100644 --- a/content/content-management/menus.md +++ b/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/content/content-management/multilingual.md b/content/content-management/multilingual.md index 8da599cd2..28a6e4fec 100644 --- a/content/content-management/multilingual.md +++ b/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 @@ -178,11 +178,6 @@ You can also set the key used to link the translations explicitly in front matte translationKey: "my-story" ``` - -{{% note %}} -**Before Hugo 0.31**, the file's directory was not considered when looking for translations. This did not work when you named all of your content files, say, `index.md`. Now we use the full content path. -{{% /note %}} - If you need distinct URLs per language, you can set the slug in the non-default language file. For example, you can define a custom slug for a French translation in the front matter of `content/about.fr.md` as follows: ```yaml @@ -192,6 +187,7 @@ slug: "a-propos" At render, Hugo will build both `/about/` and `/a-propos/` as properly linked translated pages. +For merging of content from other languages (i.e. missing content translations), see [lang.Merge](/functions/lang.merge/). ## Link to Translated Content @@ -354,7 +350,7 @@ The rendering of the main navigation works as usual. `.Site.Menus` will just con ``` -## Missing translations +## Missing Translations If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown. @@ -364,6 +360,8 @@ While translating a Hugo website, it can be handy to have a visual indicator of Hugo will generate your website with these missing translation placeholders. It might not be suited for production environments. {{% /note %}} +For merging of content from other languages (i.e. missing content translations), see [lang.Merge](/functions/lang.merge/). + ## Multilingual Themes support To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria: diff --git a/content/content-management/page-bundles.md b/content/content-management/page-bundles.md index 09aeae8ea..34620a5e2 100644 --- a/content/content-management/page-bundles.md +++ b/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/content/content-management/page-resources.md b/content/content-management/page-resources.md index f3b12d8c4..cefb1cd47 100644 --- a/content/content-management/page-resources.md +++ b/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/content/content-management/related.md b/content/content-management/related.md index 8ae6e79ce..6f66e4468 100644 --- a/content/content-management/related.md +++ b/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/content/content-management/static-files.md b/content/content-management/static-files.md index 12d27ccf2..fe5ea77e0 100644 --- a/content/content-management/static-files.md +++ b/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/content/content-management/syntax-highlighting.md b/content/content-management/syntax-highlighting.md index 67d443fd4..e7eb011c8 100644 --- a/content/content-management/syntax-highlighting.md +++ b/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/content/content-management/taxonomies.md b/content/content-management/taxonomies.md index 1a59ebe3e..287c6f899 100644 --- a/content/content-management/taxonomies.md +++ b/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/content/content-management/urls.md b/content/content-management/urls.md index dd91fbced..d33725b72 100644 --- a/content/content-management/urls.md +++ b/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/content/functions/lang.Merge.md b/content/functions/lang.Merge.md new file mode 100644 index 000000000..6e1d41c0f --- /dev/null +++ b/content/functions/lang.Merge.md @@ -0,0 +1,47 @@ +--- +title: lang.Merge +description: "Merge missing translations from other languages." +godocref: "" +workson: [] +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 for the "minority languages" with content from the main language: + + +```bash + {{ $pages := .Site.RegularPages }} + {{ .Scratch.Set "pages" $pages }} + {{ $mainSite := .Sites.First }} + {{ if ne $mainSite .Site }} + {{ .Scratch.Set "pages" ($pages | lang.Merge $mainSite.RegularPages) }} + {{ end }} + {{ $pages := .Scratch.Get "pages" }} + ``` + +{{% note %}} +Note that the slightly ugly `.Scratch` construct will not be needed once this is fixed: https://github.com/golang/go/issues/10608 +{{% /note %}} diff --git a/content/functions/scratch.md b/content/functions/scratch.md index a827db543..b8fc0e59c 100644 --- a/content/functions/scratch.md +++ b/content/functions/scratch.md @@ -32,6 +32,7 @@ See [this Go issue](https://github.com/golang/go/issues/10608) for the main moti * `Get` returns the `value` for the `key` given. * `SetInMap` takes a `key`, `mapKey` and `value` * `GetSortedMapValues` returns array of values from `key` sorted by `mapKey` +* `Delete` takes a `key` to remove `Set` and `SetInMap` can store values of any type. @@ -69,6 +70,11 @@ The usage is best illustrated with some samples: {{ $.Scratch.SetInMap "a3" "c" "CC" }} {{ $.Scratch.SetInMap "a3" "b" "BB" }} {{ $.Scratch.GetSortedMapValues "a3" }} {{/* => []interface {}{"AA", "BB", "CC"} */}} + +{{ $.Scratch.Add "a" 1 }} +{{ $.Scratch.Delete "a" }} +{{ $.Scratch.Add "a" 2 }} +{{ $.Scratch.Get "a" }} {{/* => 2 */}} ``` {{% note %}} diff --git a/content/functions/where.md b/content/functions/where.md index 3aa03296b..eb3111215 100644 --- a/content/functions/where.md +++ b/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/content/getting-started/code-toggle.md b/content/getting-started/code-toggle.md index ae3e3e84b..3e6b7da0d 100644 --- a/content/getting-started/code-toggle.md +++ b/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/content/getting-started/configuration.md b/content/getting-started/configuration.md index f6d4b63a8..8da25fd58 100644 --- a/content/getting-started/configuration.md +++ b/content/getting-started/configuration.md @@ -98,6 +98,10 @@ enableMissingTranslationPlaceholders (false) enableRobotsTXT (false) : Enable generation of `robots.txt` file. +frontmatter + +: See [Front matter Configuration](#configure-front-matter). + footnoteAnchorPrefix ("") : Prefix for footnote anchors. @@ -246,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: "↩" @@ -262,50 +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 @@ -337,6 +300,67 @@ ignoreFiles = [ "\\.foo$", "\\.boo$" ] The above is a list of regular expressions. Note that the backslash (`\`) character is escaped in this example to keep TOML happy. +## 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: + +```toml +[frontmatter] +date = ["date","publishDate", "lastmod"] +lastmod = [":git" "lastmod", "date","publishDate"] +publishDate = ["publishDate", "date"] +expiryDate = ["expiryDate"] +``` + +If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`: + + ```toml +[frontmatter] +date = [ "myDate", ":default"] +``` + +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: + + ```toml +[frontmatter] +lastmod = ["lastmod" ,":fileModTime", ":default"] +``` + + +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, `218-02-22-mypage.md` will extract the date `218-02-22`. Also, if `slug is not set, `mypage` will be used as the value for `.Slug`. + +An example: + +```toml +[frontmatter] +date = [":filename", ":default"] +``` + +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 Blackfriday [Blackfriday](https://github.com/russross/blackfriday) is Hugo's built-in Markdown rendering engine. @@ -352,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/content/news/0.27-relnotes-ready.md b/content/news/0.27-relnotes-ready.md index 3dd02d455..9251c3768 100644 --- a/content/news/0.27-relnotes-ready.md +++ b/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/content/news/0.27-relnotes.md b/content/news/0.27-relnotes.md index a4ead0816..92fc3a7b0 100644 --- a/content/news/0.27-relnotes.md +++ b/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/content/news/0.35-relnotes-ready.md b/content/news/0.35-relnotes-ready.md new file mode 100644 index 000000000..3788c0326 --- /dev/null +++ b/content/news/0.35-relnotes-ready.md @@ -0,0 +1,102 @@ + +--- +date: 2018-01-31 +title: "0.35" +description: "0.35" +slug: "0.35" +categories: ["Releases"] +--- + + The most notable new feature in Hugo `0.35` is perhaps **Headless Bundles**. + +This means that you in your `index.md` front matter can say: + +```yaml +headless: true +``` +And +* it will have no `Permalink` and no rendered HTML in `/public` +* it will not be part of `.Site.RegularPages` etc. + +But you can get it by: + +* `.Site.GetPage ...` + +The use cases are many: + +* Shared media libraries +* Reusable page content "snippets" +* ... + +But this release contains more goodies than possible to sum up in one paragraph, so study the release notes carefully. It represents **42 contributions by 8 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 [@vassudanagunta](https://github.com/vassudanagunta), [@yanzay](https://github.com/yanzay), and [@robertbasic](https://github.com/robertbasic) for their ongoing contributions. + +And as always a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the documentation and the themes site in pristine condition. + +Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), +which has received **28 contributions by 5 contributors**. A special thanks to [@bep](https://github.com/bep), [@kaushalmodi](https://github.com/kaushalmodi), [@regisphilibert](https://github.com/regisphilibert), and [@salim-b](https://github.com/salim-b) for their work on the documentation site. + + +Hugo now has: + +* 22967+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 448+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 197+ [themes](http://themes.gohugo.io/) + + +## Notes + +* Deprecate `useModTimeAsFallback` [adfd4370](https://github.com/gohugoio/hugo/commit/adfd4370b67fd7181178bd6b3b1d07356beaac71) [@bep](https://github.com/bep) [#4351](https://github.com/gohugoio/hugo/issues/4351) +* Deprecate CLI flags `canonifyURLs`, `pluralizeListTitles`, `preserveTaxonomyNames`, `uglyURLs` [f08ea02d](https://github.com/gohugoio/hugo/commit/f08ea02d24d42929676756950f3affaca7fd8c01) [@bep](https://github.com/bep) [#4347](https://github.com/gohugoio/hugo/issues/4347) +* Remove undraft command [2fa70c93](https://github.com/gohugoio/hugo/commit/2fa70c9344b231c9d999bbafdfa4acbf27ed9f6e) [@robertbasic](https://github.com/robertbasic) [#4353](https://github.com/gohugoio/hugo/issues/4353) + +## Enhancements + +### Templates + +* Update Twitter card to also consider images in `.Resources` [25d691da](https://github.com/gohugoio/hugo/commit/25d691daff57d7c6d7d0f63af3991d22e3f788fe) [@bep](https://github.com/bep) [#4349](https://github.com/gohugoio/hugo/issues/4349) +* Seed random on init only [83c761b7](https://github.com/gohugoio/hugo/commit/83c761b71a980aee6331179b271c7e24e999e8eb) [@liguoqinjim](https://github.com/liguoqinjim) +* Remove duplicate layout lookup layouts [b2fcbb1f](https://github.com/gohugoio/hugo/commit/b2fcbb1f9774aa1e929b8575c0e1ac366ab2fb73) [@bep](https://github.com/bep) [#4319](https://github.com/gohugoio/hugo/issues/4319) +* Add "removable-media" interface to `snapcraft.yaml` [f0c0ece4](https://github.com/gohugoio/hugo/commit/f0c0ece44d55b6c2997cbd106d1bc099ea1a2fa7) [@anthonyfok](https://github.com/anthonyfok) [#3837](https://github.com/gohugoio/hugo/issues/3837) + +### Other + +* Add a way to disable one or more languages [6413559f](https://github.com/gohugoio/hugo/commit/6413559f7575e2653d76227a8037a7edbaae82aa) [@bep](https://github.com/bep) [#4297](https://github.com/gohugoio/hugo/issues/4297)[#4329](https://github.com/gohugoio/hugo/issues/4329) +* Handle newly created files in Fast Render Mode [1707dae8](https://github.com/gohugoio/hugo/commit/1707dae8d3634006017eb6d040df4dbafc53d92f) [@yanzay](https://github.com/yanzay) [#4339](https://github.com/gohugoio/hugo/issues/4339) +* Extract the Fast Render Mode logic into a method [94e736c5](https://github.com/gohugoio/hugo/commit/94e736c5e167a0ee70a528e1c19d64a47e7929c2) [@bep](https://github.com/bep) [#4339](https://github.com/gohugoio/hugo/issues/4339) +* Remove unused code [ae5a45be](https://github.com/gohugoio/hugo/commit/ae5a45be6f0ee4d5c52b38fd28b22b55d9cd7b2d) [@bep](https://github.com/bep) +* Add the last lookup variant for the `GetPage` index [3446fe9b](https://github.com/gohugoio/hugo/commit/3446fe9b8937610b8b628b2c212eb25888a7c1bb) [@bep](https://github.com/bep) [#4312](https://github.com/gohugoio/hugo/issues/4312) +* Simplify bundle lookup via `.Site.GetPage`, `ref`, `relref` [517b6b62](https://github.com/gohugoio/hugo/commit/517b6b62389d23bfe41fe3ae551a691b11bdcaa7) [@bep](https://github.com/bep) [#4312](https://github.com/gohugoio/hugo/issues/4312) +* Remove some now superflous Fast Render Mode code [feeed073](https://github.com/gohugoio/hugo/commit/feeed073c3320b09fb38168ce272ac88b987f1d2) [@bep](https://github.com/bep) [#4339](https://github.com/gohugoio/hugo/issues/4339) +* Make resource counters for `name` and `title` independent [df20b054](https://github.com/gohugoio/hugo/commit/df20b05463fef42aba93d5208e410a7ecc56da5d) [@bep](https://github.com/bep) [#4335](https://github.com/gohugoio/hugo/issues/4335) +* Provide .Name to the archetype templates [863a812e](https://github.com/gohugoio/hugo/commit/863a812e07193541b42732b0e227f3d320433f01) [@bep](https://github.com/bep) [#4348](https://github.com/gohugoio/hugo/issues/4348) +* 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) +* 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) +* Shorten the stale setup [4a7c2b36](https://github.com/gohugoio/hugo/commit/4a7c2b3695fe7b88861f2155ea7ef635fe425cd4) [@bep](https://github.com/bep) +* Add a `GetPage` to the site benchmarks [a1956391](https://github.com/gohugoio/hugo/commit/a19563910eec5fed08f3b02563b9a7b38026183d) [@bep](https://github.com/bep) +* Add headless bundle support [0432c64d](https://github.com/gohugoio/hugo/commit/0432c64dd22e4610302162678bb93661ba68d758) [@bep](https://github.com/bep) [#4311](https://github.com/gohugoio/hugo/issues/4311) +* Merge matching resources params maps [5a0819b9](https://github.com/gohugoio/hugo/commit/5a0819b9b5eb9e79826cfa0a65f235d9821b1ac4) [@bep](https://github.com/bep) [#4315](https://github.com/gohugoio/hugo/issues/4315) +* Add some general code contribution criterias [78c86330](https://github.com/gohugoio/hugo/commit/78c863305f337ed4faf3cf0a23675f28b0ae5641) [@bep](https://github.com/bep) +* Tighten page kind logic, introduce tests [8125b4b0](https://github.com/gohugoio/hugo/commit/8125b4b03d10eb73f8aea3f9ea41172aba8df082) [@vassudanagunta](https://github.com/vassudanagunta) + +## Fixes +* Fix `robots.txt` in multihost mode [4d912e2a](https://github.com/gohugoio/hugo/commit/4d912e2aad39bfe8d76672cf53b01317792e02c5) [@bep](https://github.com/bep) [#4193](https://github.com/gohugoio/hugo/issues/4193) +* Fix `--uglyURLs` from comand line regression [016398ff](https://github.com/gohugoio/hugo/commit/016398ffe2e0a073453cf46a9d6bf72d693c11e5) [@bep](https://github.com/bep) [#4343](https://github.com/gohugoio/hugo/issues/4343) +* Avoid unescape in `highlight` [ebdd8cba](https://github.com/gohugoio/hugo/commit/ebdd8cba3f5965a8ac897833f313d772271de649) [@bep](https://github.com/bep) [#4219](https://github.com/gohugoio/hugo/issues/4219) +* Fix Docker build [a34213f0](https://github.com/gohugoio/hugo/commit/a34213f0b5624de101272aab469ca9b6fe0c273f) [@skoblenick](https://github.com/skoblenick) [#4076](https://github.com/gohugoio/hugo/issues/4076)[#4077](https://github.com/gohugoio/hugo/issues/4077) +* Fix language params handling [ae742cb1](https://github.com/gohugoio/hugo/commit/ae742cb1bdf35b81aa0ede5453da6b0c4a4fccf2) [@bep](https://github.com/bep) [#4356](https://github.com/gohugoio/hugo/issues/4356)[#4352](https://github.com/gohugoio/hugo/issues/4352) +* Fix handling of top-level page bundles [4eb2fec6](https://github.com/gohugoio/hugo/commit/4eb2fec67c3a72a3ac98aa834dc56fd4504626d8) [@bep](https://github.com/bep) [#4332](https://github.com/gohugoio/hugo/issues/4332) +* Fix `baseURL` server regression for multilingual sites [ed4a00e4](https://github.com/gohugoio/hugo/commit/ed4a00e46f2344320a22f07febe5aec4075cb3fb) [@bep](https://github.com/bep) [#4333](https://github.com/gohugoio/hugo/issues/4333) +* Fix "date" page param [322c5672](https://github.com/gohugoio/hugo/commit/322c567220aa4123a5d707629c1bebd375599912) [@vassudanagunta](https://github.com/vassudanagunta) [#4323](https://github.com/gohugoio/hugo/issues/4323) +* Fix typo in comment [912147ab](https://github.com/gohugoio/hugo/commit/912147ab896e69a450b7100c3d6bf81a7bf78b5a) [@yanzay](https://github.com/yanzay) + + + + + diff --git a/content/news/0.35-relnotes/index.md b/content/news/0.35-relnotes/index.md index 6ce614dfa..80b4afd7b 100644 --- a/content/news/0.35-relnotes/index.md +++ b/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/content/news/0.38-relnotes/featured-poster.png b/content/news/0.38-relnotes/featured-poster.png new file mode 100644 index 000000000..1e7988c8f Binary files /dev/null and b/content/news/0.38-relnotes/featured-poster.png differ diff --git a/content/news/0.38-relnotes/index.md b/content/news/0.38-relnotes/index.md new file mode 100644 index 000000000..88ef88872 --- /dev/null +++ b/content/news/0.38-relnotes/index.md @@ -0,0 +1,66 @@ + +--- +date: 2018-04-02 +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. + +And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site. + +Also, a shoutout to [@regisphilibert](https://github.com/regisphilibert) for his work on the new [Code Toggle Shortcode](https://gohugo.io/getting-started/code-toggle/) on the Hugo docs site, which we will put to good use to improve all the configuration samples. + +Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), +which has received **55 contributions by 18 contributors**. A special thanks to [@kaushalmodi](https://github.com/kaushalmodi), [@bep](https://github.com/bep), [@xa0082249956](https://github.com/xa0082249956), and [@paulcmal](https://github.com/paulcmal) for their work on the documentation site. + + +Hugo now has: + +* 24547+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 447+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 213+ [themes](http://themes.gohugo.io/) + +## Notes + +* Hugo now allows partial redefinition `outputs` in your site configuration. This is what most people would expect, but it is still a change in behaviour. For details, see [#4487](https://github.com/gohugoio/hugo/issues/4487) +* Before this release, Hugo flattened URLs of processed images in sub-folders. This worked fine but was not intentional. See [#4502](https://github.com/gohugoio/hugo/issues/4502). + +## Enhancements + +* Allow themes to define output formats, media types and params [e9c7b620](https://github.com/gohugoio/hugo/commit/e9c7b6205f94a7edac0e0df2cd18d1456cb26a06) [@bep](https://github.com/bep) [#4490](https://github.com/gohugoio/hugo/issues/4490) +* Allow partial redefinition of the `ouputs` config [f8dc47ee](https://github.com/gohugoio/hugo/commit/f8dc47eeffa847fd0b51e376da355e3d957848a6) [@bep](https://github.com/bep) [#4487](https://github.com/gohugoio/hugo/issues/4487) +* Add a way to merge pages by language [ffaec4ca](https://github.com/gohugoio/hugo/commit/ffaec4ca8c4c6fd05b195879ccd65acf2fd5a6ac) [@bep](https://github.com/bep) [#4463](https://github.com/gohugoio/hugo/issues/4463) +* Extract `date` and `slug` from filename [68bf1511](https://github.com/gohugoio/hugo/commit/68bf1511f2be39b6576d882d071196e477c72c9f) [@bep](https://github.com/bep) [#285](https://github.com/gohugoio/hugo/issues/285)[#3310](https://github.com/gohugoio/hugo/issues/3310)[#3762](https://github.com/gohugoio/hugo/issues/3762)[#4340](https://github.com/gohugoio/hugo/issues/4340) +* Add `Delete` method to delete key from `Scratch` [e46ab29b](https://github.com/gohugoio/hugo/commit/e46ab29bd24caa9e2cfa51f24ba15037750850d6) [@paulcmal](https://github.com/paulcmal) +* Simplify Prev/Next [79dd7cb3](https://github.com/gohugoio/hugo/commit/79dd7cb31a941d7545df33b938ca3ed46593ddfd) [@bep](https://github.com/bep) +* List Chroma lexers [2c54f1ad](https://github.com/gohugoio/hugo/commit/2c54f1ad48fe2a2f7504117d351d45abc89dcb1f) [@bep](https://github.com/bep) [#4554](https://github.com/gohugoio/hugo/issues/4554) +* Add support for a `contentDir` set per language [eb42774e](https://github.com/gohugoio/hugo/commit/eb42774e587816b1fbcafbcea59ed65df703882a) [@bep](https://github.com/bep) [#4523](https://github.com/gohugoio/hugo/issues/4523)[#4552](https://github.com/gohugoio/hugo/issues/4552)[#4553](https://github.com/gohugoio/hugo/issues/4553) +* Update Chroma [7a634898](https://github.com/gohugoio/hugo/commit/7a634898c359a6af0da52be17df07cae97c7937c) [@bep](https://github.com/bep) [#4549](https://github.com/gohugoio/hugo/issues/4549) +* Add `.Site.IsServer` [1823c053](https://github.com/gohugoio/hugo/commit/1823c053c8900cb6ee53b8e5c02939c7398e34dd) [@felicianotech](https://github.com/felicianotech) [#4478](https://github.com/gohugoio/hugo/issues/4478) +* Move to Ubuntu Trusty image [511d5d3b](https://github.com/gohugoio/hugo/commit/511d5d3b7681cb76822098f430ed6862232ca529) [@anthonyfok](https://github.com/anthonyfok) +* Bump some deprecations [b6798ee8](https://github.com/gohugoio/hugo/commit/b6798ee8676c48f86b0bd8581ea244f4be4ef3fa) [@bep](https://github.com/bep) +* Update Chroma to get `Go template support` [904a3d9d](https://github.com/gohugoio/hugo/commit/904a3d9ddf523d452d04d0b5814503e0ff17bd2e) [@bep](https://github.com/bep) [#4515](https://github.com/gohugoio/hugo/issues/4515) +* Recover from error in server [f0052b6d](https://github.com/gohugoio/hugo/commit/f0052b6d0f8e113a50aeb6cd7bd34555dbf34a00) [@bep](https://github.com/bep) [#4516](https://github.com/gohugoio/hugo/issues/4516) +* Spring test cleaning, take 2 [da880157](https://github.com/gohugoio/hugo/commit/da88015776645cc68b96e8b94030c95905df53ae) [@bep](https://github.com/bep) +* Add docs for `lang.Merge` [70005364](https://github.com/gohugoio/hugo/commit/70005364a245ea3bc59c74192e1f4c56cb6879cf) [@bep](https://github.com/bep) +* Remove archetype title/date warning [ac12d51e](https://github.com/gohugoio/hugo/commit/ac12d51e7ea3a0ffb7d8053a10b6bf6acf1235ae) [@bep](https://github.com/bep) [#4504](https://github.com/gohugoio/hugo/issues/4504) +* Add docs on the new front matter configuration [0dbf79c2](https://github.com/gohugoio/hugo/commit/0dbf79c2f8cd5b1a5c91c04a8d677f956b0b8fe8) [@bep](https://github.com/bep) [#4495](https://github.com/gohugoio/hugo/issues/4495) +* Refactor the GitInfo into the date handlers [ce6e4310](https://github.com/gohugoio/hugo/commit/ce6e4310febf5659392a41b543594382441f3681) [@bep](https://github.com/bep) [#4495](https://github.com/gohugoio/hugo/issues/4495) +* Do not print build total when `--quiet` is set [50a03a5a](https://github.com/gohugoio/hugo/commit/50a03a5acc7c200c795590c3f4b964fdc56085f2) [@bep](https://github.com/bep) [#4456](https://github.com/gohugoio/hugo/issues/4456) + +## Fixes + +* Fix freeze in invalid front matter error case [93e24a03](https://github.com/gohugoio/hugo/commit/93e24a03ce98d3212a2d49ad04739141229d0809) [@bep](https://github.com/bep) [#4526](https://github.com/gohugoio/hugo/issues/4526) +* Fix path duplication/flattening in processed images [3fbc7553](https://github.com/gohugoio/hugo/commit/3fbc75534d1acda2be1c597aa77c919d3a02659d) [@bep](https://github.com/bep) [#4502](https://github.com/gohugoio/hugo/issues/4502)[#4501](https://github.com/gohugoio/hugo/issues/4501) +* Fix SVG and similar resource handling [ba94abbf](https://github.com/gohugoio/hugo/commit/ba94abbf5dd90f989242af8a7027d67a572a6128) [@bep](https://github.com/bep) [#4455](https://github.com/gohugoio/hugo/issues/4455) + + + + diff --git a/content/news/0.38.1-relnotes/index.md b/content/news/0.38.1-relnotes/index.md new file mode 100644 index 000000000..b900b6fb0 --- /dev/null +++ b/content/news/0.38.1-relnotes/index.md @@ -0,0 +1,32 @@ + +--- +date: 2018-04-05 +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 + +--- + + + +This is a bug-fix that is mainly motivated by some issues with server live reloading introduced in Hugo 0.38. + +* Fix livereload for the home page bundle [f87239e4](https://github.com/gohugoio/hugo/commit/f87239e4cab958bf59ecfb1beb8cac439441a553) [@bep](https://github.com/bep) [#4576](https://github.com/gohugoio/hugo/issues/4576) +* Fix empty BuildDate in "hugo version" [294c0f80](https://github.com/gohugoio/hugo/commit/294c0f8001fe598278c1eb8015deb6b98e8de686) [@anthonyfok](https://github.com/anthonyfok) +* Fix some livereload content regressions [a4deaeff](https://github.com/gohugoio/hugo/commit/a4deaeff0cfd70abfbefa6d40c0b86839a216f6d) [@bep](https://github.com/bep) [#4566](https://github.com/gohugoio/hugo/issues/4566) +* Update github.com/bep/gitmap to fix snap build [4d115c56](https://github.com/gohugoio/hugo/commit/4d115c56fac9060230fbac6181a05f7cc6d10b42) [@anthonyfok](https://github.com/anthonyfok) [#4538](https://github.com/gohugoio/hugo/issues/4538) +* Fix two tests that are broken on Windows [26f34fd5](https://github.com/gohugoio/hugo/commit/26f34fd59da1ce1885d4f2909c5d9ef9c1726944) [@neurocline](https://github.com/neurocline) + + +This release also contains some improvements: + +* Add bash completion [874159b5](https://github.com/gohugoio/hugo/commit/874159b5436bc9080aec71a9c26d35f8f62c9fd0) [@anthonyfok](https://github.com/anthonyfok) +* Handle mass content etc. edits in server mode [730b66b6](https://github.com/gohugoio/hugo/commit/730b66b6520f263af16f555d1d7be51205a8e51d) [@bep](https://github.com/bep) [#4563](https://github.com/gohugoio/hugo/issues/4563) + + + + + + diff --git a/content/news/0.38.2-relnotes/index.md b/content/news/0.38.2-relnotes/index.md new file mode 100644 index 000000000..bac85a057 --- /dev/null +++ b/content/news/0.38.2-relnotes/index.md @@ -0,0 +1,25 @@ + +--- +date: 2018-04-09 +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 + +--- + + +This is a bug-fix release with a couple of important fixes: + + +* Fix handling of the `--contentDir` and possibly other related flags [080302eb](https://github.com/gohugoio/hugo/commit/080302eb8757fd94ccbd6bf99103432cd98e716c) [@bep](https://github.com/bep) [#4589](https://github.com/gohugoio/hugo/issues/4589) +* Fix handling of content files with "." in them [2817e842](https://github.com/gohugoio/hugo/commit/2817e842407c8dcbfc738297ab634392fcb41ce1) [@bep](https://github.com/bep) [#4559](https://github.com/gohugoio/hugo/issues/4559) + + +Also in this release: + +* Set .Parent in bundled pages to its owner [6792d86a](https://github.com/gohugoio/hugo/commit/6792d86ad028571c684a776c5f00e0107838c955) [@bep](https://github.com/bep) [#4582](https://github.com/gohugoio/hugo/issues/4582) + + + diff --git a/content/templates/data-templates.md b/content/templates/data-templates.md index c0b2b5145..460a657ef 100644 --- a/content/templates/data-templates.md +++ b/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/content/templates/internal.md b/content/templates/internal.md index 6f8d4e864..7fbfec43c 100644 --- a/content/templates/internal.md +++ b/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/content/templates/introduction.md b/content/templates/introduction.md index 95db7eab8..32df11297 100644 --- a/content/templates/introduction.md +++ b/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/content/templates/menu-templates.md b/content/templates/menu-templates.md index 9eba3dc1b..5efb080d8 100644 --- a/content/templates/menu-templates.md +++ b/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/content/templates/output-formats.md b/content/templates/output-formats.md index 9af68f5e0..ff286c9d2 100644 --- a/content/templates/output-formats.md +++ b/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/content/templates/sitemap-template.md b/content/templates/sitemap-template.md index 98a4c2b1d..29b59ad12 100644 --- a/content/templates/sitemap-template.md +++ b/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/content/tools/search.md b/content/tools/search.md index 149bdfe05..2145c187c 100644 --- a/content/tools/search.md +++ b/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/content/variables/site.md b/content/variables/site.md index 00b1d20e7..a5909a563 100644 --- a/content/variables/site.md +++ b/content/variables/site.md @@ -52,6 +52,9 @@ The following is a list of site-level (aka "global") variables. Many of these va .Site.IsMultiLingual : whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information. +.Site.IsServer +: a boolean to indicate if the site is being served with Hugo's built-in server. See [`hugo server`](/commands/hugo_server/) for more information. + .Site.Language.Lang : the language code of the current locale (e.g., `en`). @@ -106,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: @@ -122,4 +125,4 @@ You can use `.Site.Params` in a [partial template](/templates/partials/) to call {{< /code >}} -[config]: /getting-started/configuration/ \ No newline at end of file +[config]: /getting-started/configuration/ diff --git a/data/docs.json b/data/docs.json index 641d32818..593dcabdf 100644 --- a/data/docs.json +++ b/data/docs.json @@ -1,4 +1,1222 @@ { + "chroma": { + "lexers": [ + { + "Name": "ABNF", + "Aliases": [ + "abnf" + ] + }, + { + "Name": "ANTLR", + "Aliases": [ + "antlr" + ] + }, + { + "Name": "APL", + "Aliases": [ + "apl" + ] + }, + { + "Name": "ActionScript", + "Aliases": [ + "actionscript", + "as" + ] + }, + { + "Name": "ActionScript 3", + "Aliases": [ + "actionscript3", + "as", + "as3" + ] + }, + { + "Name": "Ada", + "Aliases": [ + "ada", + "ada2005", + "ada95", + "adb", + "ads" + ] + }, + { + "Name": "Angular2", + "Aliases": [ + "ng2" + ] + }, + { + "Name": "ApacheConf", + "Aliases": [ + "aconf", + "apache", + "apacheconf", + "conf", + "htaccess" + ] + }, + { + "Name": "AppleScript", + "Aliases": [ + "applescript" + ] + }, + { + "Name": "Awk", + "Aliases": [ + "awk", + "gawk", + "mawk", + "nawk" + ] + }, + { + "Name": "BNF", + "Aliases": [ + "bnf" + ] + }, + { + "Name": "Base Makefile", + "Aliases": [ + "bsdmake", + "mak", + "make", + "makefile", + "mf", + "mk" + ] + }, + { + "Name": "Bash", + "Aliases": [ + "bash", + "bashrc", + "ebuild", + "eclass", + "exheres-0", + "exlib", + "ksh", + "sh", + "shell", + "zsh", + "zshrc" + ] + }, + { + "Name": "Batchfile", + "Aliases": [ + "bat", + "batch", + "cmd", + "dosbatch", + "winbatch" + ] + }, + { + "Name": "BlitzBasic", + "Aliases": [ + "b3d", + "bb", + "blitzbasic", + "bplus", + "decls" + ] + }, + { + "Name": "Brainfuck", + "Aliases": [ + "b", + "bf", + "brainfuck" + ] + }, + { + "Name": "C", + "Aliases": [ + "c", + "h", + "idc" + ] + }, + { + "Name": "C#", + "Aliases": [ + "c#", + "cs", + "csharp" + ] + }, + { + "Name": "C++", + "Aliases": [ + "C", + "CPP", + "H", + "c++", + "cc", + "cp", + "cpp", + "cxx", + "h++", + "hh", + "hpp", + "hxx" + ] + }, + { + "Name": "CFEngine3", + "Aliases": [ + "cf", + "cf3", + "cfengine3" + ] + }, + { + "Name": "CMake", + "Aliases": [ + "cmake", + "txt" + ] + }, + { + "Name": "COBOL", + "Aliases": [ + "COB", + "CPY", + "cob", + "cobol", + "cpy" + ] + }, + { + "Name": "CSS", + "Aliases": [ + "css" + ] + }, + { + "Name": "Cap'n Proto", + "Aliases": [ + "capnp" + ] + }, + { + "Name": "Ceylon", + "Aliases": [ + "ceylon" + ] + }, + { + "Name": "ChaiScript", + "Aliases": [ + "chai", + "chaiscript" + ] + }, + { + "Name": "Cheetah", + "Aliases": [ + "cheetah", + "spitfire", + "spt", + "tmpl" + ] + }, + { + "Name": "Clojure", + "Aliases": [ + "clj", + "clojure" + ] + }, + { + "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": "Cython", + "Aliases": [ + "cython", + "pxd", + "pxi", + "pyrex", + "pyx" + ] + }, + { + "Name": "DTD", + "Aliases": [ + "dtd" + ] + }, + { + "Name": "Dart", + "Aliases": [ + "dart" + ] + }, + { + "Name": "Diff", + "Aliases": [ + "diff", + "patch", + "udiff" + ] + }, + { + "Name": "Django/Jinja", + "Aliases": [ + "django", + "jinja" + ] + }, + { + "Name": "Docker", + "Aliases": [ + "docker", + "dockerfile" + ] + }, + { + "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": "FSharp", + "Aliases": [ + "fs", + "fsharp", + "fsi" + ] + }, + { + "Name": "Factor", + "Aliases": [ + "factor" + ] + }, + { + "Name": "Fish", + "Aliases": [ + "fish", + "fishshell", + "load" + ] + }, + { + "Name": "Forth", + "Aliases": [ + "forth", + "frt", + "fs" + ] + }, + { + "Name": "Fortran", + "Aliases": [ + "F03", + "F90", + "f03", + "f90", + "fortran" + ] + }, + { + "Name": "GAS", + "Aliases": [ + "S", + "asm", + "gas", + "s" + ] + }, + { + "Name": "GDScript", + "Aliases": [ + "gd", + "gdscript" + ] + }, + { + "Name": "GLSL", + "Aliases": [ + "frag", + "geo", + "glsl", + "vert" + ] + }, + { + "Name": "Genshi", + "Aliases": [ + "genshi", + "kid", + "xml+genshi", + "xml+kid" + ] + }, + { + "Name": "Genshi HTML", + "Aliases": [ + "html+genshi", + "html+kid" + ] + }, + { + "Name": "Genshi Text", + "Aliases": [ + "genshitext" + ] + }, + { + "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": "Groovy", + "Aliases": [ + "gradle", + "groovy" + ] + }, + { + "Name": "HTML", + "Aliases": [ + "htm", + "html", + "xhtml", + "xslt" + ] + }, + { + "Name": "HTTP", + "Aliases": [ + "http" + ] + }, + { + "Name": "Handlebars", + "Aliases": [ + "handlebars" + ] + }, + { + "Name": "Haskell", + "Aliases": [ + "haskell", + "hs" + ] + }, + { + "Name": "Haxe", + "Aliases": [ + "haxe", + "hx", + "hxsl" + ] + }, + { + "Name": "Hexdump", + "Aliases": [ + "hexdump" + ] + }, + { + "Name": "Hy", + "Aliases": [ + "hy", + "hylang" + ] + }, + { + "Name": "INI", + "Aliases": [ + "cfg", + "dosini", + "inf", + "ini" + ] + }, + { + "Name": "Idris", + "Aliases": [ + "idr", + "idris" + ] + }, + { + "Name": "Io", + "Aliases": [ + "io" + ] + }, + { + "Name": "JSON", + "Aliases": [ + "json" + ] + }, + { + "Name": "JSX", + "Aliases": [ + "jsx", + "react" + ] + }, + { + "Name": "Java", + "Aliases": [ + "java" + ] + }, + { + "Name": "JavaScript", + "Aliases": [ + "javascript", + "js", + "jsm" + ] + }, + { + "Name": "Julia", + "Aliases": [ + "jl", + "julia" + ] + }, + { + "Name": "Kotlin", + "Aliases": [ + "kotlin", + "kt" + ] + }, + { + "Name": "LLVM", + "Aliases": [ + "ll", + "llvm" + ] + }, + { + "Name": "Lighttpd configuration file", + "Aliases": [ + "lighttpd", + "lighty" + ] + }, + { + "Name": "Lua", + "Aliases": [ + "lua", + "wlua" + ] + }, + { + "Name": "Mako", + "Aliases": [ + "mako", + "mao" + ] + }, + { + "Name": "Mason", + "Aliases": [ + "m", + "mason", + "mc", + "mhtml", + "mi" + ] + }, + { + "Name": "Mathematica", + "Aliases": [ + "cdf", + "ma", + "mathematica", + "mma", + "nb", + "nbp" + ] + }, + { + "Name": "MiniZinc", + "Aliases": [ + "MZN", + "dzn", + "fzn", + "minizinc", + "mzn" + ] + }, + { + "Name": "Modula-2", + "Aliases": [ + "def", + "m2", + "mod", + "modula2" + ] + }, + { + "Name": "MorrowindScript", + "Aliases": [ + "morrowind", + "mwscript" + ] + }, + { + "Name": "MySQL", + "Aliases": [ + "mysql", + "sql" + ] + }, + { + "Name": "Myghty", + "Aliases": [ + "myghty", + "myt" + ] + }, + { + "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": "OCaml", + "Aliases": [ + "ml", + "mli", + "mll", + "mly", + "ocaml" + ] + }, + { + "Name": "Objective-C", + "Aliases": [ + "h", + "m", + "obj-c", + "objc", + "objective-c", + "objectivec" + ] + }, + { + "Name": "Octave", + "Aliases": [ + "m", + "octave" + ] + }, + { + "Name": "PHP", + "Aliases": [ + "inc", + "php", + "php3", + "php4", + "php5", + "php[345]" + ] + }, + { + "Name": "PL/pgSQL", + "Aliases": [ + "plpgsql" + ] + }, + { + "Name": "POVRay", + "Aliases": [ + "inc", + "pov" + ] + }, + { + "Name": "PacmanConf", + "Aliases": [ + "conf", + "pacmanconf" + ] + }, + { + "Name": "Perl", + "Aliases": [ + "perl", + "pl", + "pm", + "t" + ] + }, + { + "Name": "Pig", + "Aliases": [ + "pig" + ] + }, + { + "Name": "PkgConfig", + "Aliases": [ + "pc", + "pkgconfig" + ] + }, + { + "Name": "PostScript", + "Aliases": [ + "eps", + "postscr", + "postscript", + "ps" + ] + }, + { + "Name": "PostgreSQL SQL dialect", + "Aliases": [ + "postgres", + "postgresql" + ] + }, + { + "Name": "PowerShell", + "Aliases": [ + "posh", + "powershell", + "ps1", + "psm1" + ] + }, + { + "Name": "Prolog", + "Aliases": [ + "ecl", + "pl", + "pro", + "prolog" + ] + }, + { + "Name": "Protocol Buffer", + "Aliases": [ + "proto", + "protobuf" + ] + }, + { + "Name": "Puppet", + "Aliases": [ + "pp", + "puppet" + ] + }, + { + "Name": "Python", + "Aliases": [ + "py", + "python", + "pyw", + "sage", + "sc", + "tac" + ] + }, + { + "Name": "Python 3", + "Aliases": [ + "py3", + "python3" + ] + }, + { + "Name": "QBasic", + "Aliases": [ + "BAS", + "bas", + "basic", + "qbasic" + ] + }, + { + "Name": "R", + "Aliases": [ + "R", + "Renviron", + "Rhistory", + "Rprofile", + "S", + "r", + "s", + "splus" + ] + }, + { + "Name": "Racket", + "Aliases": [ + "racket", + "rkt", + "rktd", + "rktl" + ] + }, + { + "Name": "Ragel", + "Aliases": [ + "ragel" + ] + }, + { + "Name": "Rexx", + "Aliases": [ + "arexx", + "rex", + "rexx", + "rx" + ] + }, + { + "Name": "Ruby", + "Aliases": [ + "duby", + "gemspec", + "rake", + "rb", + "rbw", + "rbx", + "ruby" + ] + }, + { + "Name": "Rust", + "Aliases": [ + "in", + "rs", + "rust" + ] + }, + { + "Name": "SCSS", + "Aliases": [ + "scss" + ] + }, + { + "Name": "SPARQL", + "Aliases": [ + "rq", + "sparql" + ] + }, + { + "Name": "SQL", + "Aliases": [ + "sql" + ] + }, + { + "Name": "Sass", + "Aliases": [ + "sass" + ] + }, + { + "Name": "Scala", + "Aliases": [ + "scala" + ] + }, + { + "Name": "Scheme", + "Aliases": [ + "scheme", + "scm", + "ss" + ] + }, + { + "Name": "Scilab", + "Aliases": [ + "sce", + "sci", + "scilab", + "tst" + ] + }, + { + "Name": "Smalltalk", + "Aliases": [ + "smalltalk", + "squeak", + "st" + ] + }, + { + "Name": "Smarty", + "Aliases": [ + "smarty", + "tpl" + ] + }, + { + "Name": "Snobol", + "Aliases": [ + "snobol" + ] + }, + { + "Name": "Solidity", + "Aliases": [ + "sol", + "solidity" + ] + }, + { + "Name": "SquidConf", + "Aliases": [ + "conf", + "squid", + "squid.conf", + "squidconf" + ] + }, + { + "Name": "Swift", + "Aliases": [ + "swift" + ] + }, + { + "Name": "TASM", + "Aliases": [ + "ASM", + "asm", + "tasm" + ] + }, + { + "Name": "TOML", + "Aliases": [ + "toml" + ] + }, + { + "Name": "Tcl", + "Aliases": [ + "rvt", + "tcl" + ] + }, + { + "Name": "Tcsh", + "Aliases": [ + "csh", + "tcsh" + ] + }, + { + "Name": "TeX", + "Aliases": [ + "aux", + "latex", + "tex", + "toc" + ] + }, + { + "Name": "Termcap", + "Aliases": [ + "src", + "termcap" + ] + }, + { + "Name": "Terminfo", + "Aliases": [ + "src", + "terminfo" + ] + }, + { + "Name": "Terraform", + "Aliases": [ + "terraform", + "tf" + ] + }, + { + "Name": "Thrift", + "Aliases": [ + "thrift" + ] + }, + { + "Name": "Transact-SQL", + "Aliases": [ + "t-sql", + "tsql" + ] + }, + { + "Name": "Turtle", + "Aliases": [ + "ttl", + "turtle" + ] + }, + { + "Name": "Twig", + "Aliases": [ + "twig" + ] + }, + { + "Name": "TypeScript", + "Aliases": [ + "ts", + "tsx", + "typescript" + ] + }, + { + "Name": "TypoScript", + "Aliases": [ + "ts", + "txt", + "typoscript" + ] + }, + { + "Name": "TypoScriptCssData", + "Aliases": [ + "typoscriptcssdata" + ] + }, + { + "Name": "TypoScriptHtmlData", + "Aliases": [ + "typoscripthtmldata" + ] + }, + { + "Name": "VHDL", + "Aliases": [ + "vhd", + "vhdl" + ] + }, + { + "Name": "VimL", + "Aliases": [ + "exrc", + "gvimrc", + "vim", + "vimrc" + ] + }, + { + "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": "cfstatement", + "Aliases": [ + "cfs" + ] + }, + { + "Name": "markdown", + "Aliases": [ + "markdown", + "md", + "mkd" + ] + }, + { + "Name": "reStructuredText", + "Aliases": [ + "rest", + "restructuredtext", + "rst" + ] + }, + { + "Name": "reg", + "Aliases": [ + "reg", + "registry" + ] + }, + { + "Name": "systemverilog", + "Aliases": [ + "sv", + "svh", + "systemverilog" + ] + }, + { + "Name": "verilog", + "Aliases": [ + "v", + "verilog" + ] + } + ] + }, "media": { "types": [ { @@ -197,6 +1415,26 @@ "noUgly": false, "notAlternative": false }, + { + "MediaType": "text/plain+txt", + "name": "ROBOTS", + "mediaType": { + "type": "text/plain", + "string": "text/plain+txt", + "mainType": "text", + "subType": "plain", + "suffix": "txt", + "delimiter": "." + }, + "path": "", + "baseName": "robots", + "rel": "alternate", + "protocol": "", + "isPlainText": true, + "isHTML": false, + "noUgly": false, + "notAlternative": false + }, { "MediaType": "application/rss+xml", "name": "RSS", @@ -216,6 +1454,26 @@ "isHTML": false, "noUgly": true, "notAlternative": false + }, + { + "MediaType": "application/xml+xml", + "name": "Sitemap", + "mediaType": { + "type": "application/xml", + "string": "application/xml+xml", + "mainType": "application", + "subType": "xml", + "suffix": "xml", + "delimiter": "." + }, + "path": "", + "baseName": "sitemap", + "rel": "sitemap", + "protocol": "", + "isPlainText": false, + "isHTML": false, + "noUgly": true, + "notAlternative": false } ], "layouts": [ @@ -1430,6 +2688,12 @@ } }, "lang": { + "Merge": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, "NumFmt": { "Description": "NumFmt 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`.", "Args": [ diff --git a/layouts/shortcodes/chroma-lexers.html b/layouts/shortcodes/chroma-lexers.html new file mode 100644 index 000000000..0df2b868f --- /dev/null +++ b/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/layouts/shortcodes/code.html b/layouts/shortcodes/code.html index 83220c47d..2ee20b1eb 100644 --- a/layouts/shortcodes/code.html +++ b/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/netlify.toml b/netlify.toml index 5955d26cd..0f24d5ae3 100644 --- a/netlify.toml +++ b/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/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_480x0_resize_catmullrom_2.png b/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/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_480x0_resize_catmullrom_2.png differ diff --git a/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_640x0_resize_catmullrom_2.png b/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/resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_640x0_resize_catmullrom_2.png differ diff --git a/themes/gohugoioTheme/data/sponsors.toml b/themes/gohugoioTheme/data/sponsors.toml index 5e35a25dc..eb9964f39 100644 --- a/themes/gohugoioTheme/data/sponsors.toml +++ b/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/themes/gohugoioTheme/src/css/_tabs.css b/themes/gohugoioTheme/src/css/_tabs.css index 4ed15b63d..6e0022cc9 100644 --- a/themes/gohugoioTheme/src/css/_tabs.css +++ b/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/themes/gohugoioTheme/static/dist/app.bundle.js b/themes/gohugoioTheme/static/dist/app.bundle.js index 6391e71e9..7ea75e36f 100644 --- a/themes/gohugoioTheme/static/dist/app.bundle.js +++ b/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","