summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-16 07:43:59 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-16 07:43:59 +0200
commit047c4188dfc854f658d16f1e4a9501f9c97a31c7 (patch)
treeb552b6efac7f1c3671074901aa0b4fe5999b7998
parented8bf081fdbf336e026517b7e1b123c039014ab5 (diff)
Squashed 'docs/' changes from d9c8fc220..f9a5dc59b
f9a5dc59b Code Toggle block added to doc site final batch Templates ✅ Variables ✅ 4d4107968 Add eSolia as new sponsor 000fed94e Add missing closing tags for li in menu template example f462b620f Clarify that local CSV files cannot be inside data dir ae083641a Added hugo-search-index to list of search tools e2b64d0b7 Remove extra link 2fb4c9af5 Release 0.38.2 59b1c9853 releaser: Prepare repository for 0.39-DEV 92f6a05ea releaser: Add release notes to /docs for release of 0.38.2 76244729e releaser: Bump versions for release of 0.38.2 0960c5fb3 Adjust gray color of tab vs pane in code-toggle. 8ae3aadd7 use code-toggle shortcode when relevant Content Management ✅ 455b8b53b Update related.md 6e8d19090 Release 0.38.1 079ba044c releaser: Prepare repository for 0.39-DEV 6f23e6ec1 releaser: Add release notes to /docs for release of 0.38.1 c51692ceb releaser: Bump versions for release of 0.38.1 d37ea6a5e Update related.md faa2707d0 Update index.md 9ce901dcb Add a forgotten language tag (go-html-template) for code b05aaed14 Update where.md 4d4760819 Fix typo in code-toggle.md c5a5250a1 Use the new go-html-template Chroma lexer 2de831f4b Add the full list of Chroma lexers 18114d4b4 Update Output Formats b069d7f84 Release 0.38 caaa8355a releaser: Prepare repository for 0.39-DEV e45b7cc9f releaser: Add release notes to /docs for release of 0.38 40f40906e releaser: Bump versions for release of 0.38 2d52e2e4e Merge commit 'ed8bf081fdbf336e026517b7e1b123c039014ab5' 1439f64a0 docs: Generate docshelper data 5b0edfd79 Add .Site.IsServer fdb579ad1 Merge commit '0a23baa6a90901f772c234107c4f12c16c76f4aa' 7b71da1f8 hugolib: Add Reset method to delete key from Scratch 63a131664 docs: Add docs for lang.Merge 55cba056d Merge commit '3886fc1fef6ac19d58b9ba1bb642d0c6c9a54031' 6f301ebcc docs: Add docs on the new front matter configuration 7ba35ef56 Merge commit 'c0290655825e7bb36e13fb39f89d85b392cf1adc' 3d2cab754 releaser: Prepare repository for 0.38-DEV 095e888e1 releaser: Add release notes to /docs for release of 0.37.1 593fa0dcb releaser: Bump versions for release of 0.37.1 c18c1df54 releaser: Prepare repository for 0.38-DEV git-subtree-dir: docs git-subtree-split: f9a5dc59b77d15cc2c7534e10bcd90bcfeda7bb4
-rw-r--r--config.toml2
-rw-r--r--content/about/new-in-032/index.md10
-rw-r--r--content/content-management/comments.md10
-rw-r--r--content/content-management/front-matter.md38
-rw-r--r--content/content-management/image-processing/index.md4
-rw-r--r--content/content-management/menus.md22
-rw-r--r--content/content-management/multilingual.md24
-rw-r--r--content/content-management/page-bundles.md2
-rw-r--r--content/content-management/page-resources.md44
-rw-r--r--content/content-management/related.md5
-rw-r--r--content/content-management/static-files.md6
-rw-r--r--content/content-management/syntax-highlighting.md7
-rw-r--r--content/content-management/taxonomies.md78
-rw-r--r--content/content-management/urls.md13
-rw-r--r--content/functions/lang.Merge.md47
-rw-r--r--content/functions/scratch.md6
-rw-r--r--content/functions/where.md14
-rw-r--r--content/getting-started/code-toggle.md4
-rw-r--r--content/getting-started/configuration.md127
-rw-r--r--content/news/0.27-relnotes-ready.md2
-rw-r--r--content/news/0.27-relnotes.md2
-rw-r--r--content/news/0.35-relnotes-ready.md102
-rw-r--r--content/news/0.35-relnotes/index.md2
-rw-r--r--content/news/0.38-relnotes/featured-poster.pngbin0 -> 69978 bytes
-rw-r--r--content/news/0.38-relnotes/index.md66
-rw-r--r--content/news/0.38.1-relnotes/index.md32
-rw-r--r--content/news/0.38.2-relnotes/index.md25
-rw-r--r--content/templates/data-templates.md12
-rw-r--r--content/templates/internal.md16
-rw-r--r--content/templates/introduction.md2
-rw-r--r--content/templates/menu-templates.md63
-rw-r--r--content/templates/output-formats.md67
-rw-r--r--content/templates/sitemap-template.md4
-rw-r--r--content/tools/search.md1
-rw-r--r--content/variables/site.md11
-rw-r--r--data/docs.json1264
-rw-r--r--layouts/shortcodes/chroma-lexers.html6
-rw-r--r--layouts/shortcodes/code.html3
-rw-r--r--netlify.toml8
-rw-r--r--resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_480x0_resize_catmullrom_2.pngbin0 -> 30670 bytes
-rw-r--r--resources/_gen/images/news/0.38-relnotes/featured-poster_hudf8012d38ef42d46a6cab1b31156bf3a_69978_640x0_resize_catmullrom_2.pngbin0 -> 50111 bytes
-rw-r--r--themes/gohugoioTheme/data/sponsors.toml6
-rw-r--r--themes/gohugoioTheme/src/css/_tabs.css8
-rw-r--r--themes/gohugoioTheme/static/dist/app.bundle.js11880
-rw-r--r--themes/gohugoioTheme/static/dist/main.css2
-rw-r--r--themes/gohugoioTheme/static/images/sponsors/esolia-logo.svg67
46 files changed, 13746 insertions, 368 deletions
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 }}
<li><a href="{{ .RelPermalink }}">{{ .ResourceType | title }}</a></li>
{{ 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 . }}
<h3>{{ .Title }}</h3>
@@ -146,7 +146,7 @@ This is the shortcode used in the examples above:
And it is used like this:
-```html
+```go-html-template
{{</* imgproc sunset Resize "300x" */>}}
```
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"
-```
+{{</ code-toggle >}}
For many websites, this is enough configuration. However, you also have the option to set the following in the [front matter][] of a single content file:
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"
-}
-```
+{{</ code-toggle >}}
## 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
{{</* imgproc sunset Resize "300x" /*/>}}
```
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 = "<i class='fa fa-heart'></i>"
@@ -132,23 +132,7 @@ Here’s an example snippet pulled from a `config.toml`:
pre = "<i class='fa fa-road'></i>"
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: "<i class='fa fa-heart'></i>"
- weight: -110
- identifier: "about"
- url: "/about/"
- - name: "getting started"
- pre: "<i class='fa fa-road'></i>"
- 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"
-```
+{{</ code-toggle >}}
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 >}}
+{{</ code-toggle >}}
## 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*" }}
<h2>Authors</h2>
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"
-~~~
-
+{{</ code-toggle >}}
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"
-~~~
+{{</ code-toggle >}}
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 directori