Permalink
Browse files

Merge commit '98293eaa1570b5aff4452021c8b6d6c8560b3f06'

  • Loading branch information...
bep committed Jul 6, 2018
1 parent ef3d639 commit bb20442df106344c42cc3e425f13e7d118006bf3
Showing with 270 additions and 56 deletions.
  1. +19 −0 content/en/about/hugo-and-gdpr.md
  2. +102 −28 content/en/content-management/multilingual.md
  3. +5 −0 content/en/content-management/shortcodes.md
  4. +7 −1 content/en/content-management/syntax-highlighting.md
  5. +7 −4 content/en/functions/errorf.md
  6. +1 −1 content/en/getting-started/usage.md
  7. BIN content/en/news/0.42-relnotes/featured-hugo-42-poster.png
  8. +2 −2 content/en/news/0.42-relnotes/index.md
  9. +2 −2 content/en/news/0.42.1-relnotes/index.md
  10. +3 −4 content/en/news/0.42.2-relnotes/index.md
  11. BIN content/en/news/lets-celebrate-hugos-5th-birthday/featured.png
  12. BIN content/en/news/lets-celebrate-hugos-5th-birthday/graph-stars.png
  13. BIN content/en/news/lets-celebrate-hugos-5th-birthday/graph-themes.png
  14. +108 −0 content/en/news/lets-celebrate-hugos-5th-birthday/index.md
  15. BIN content/en/news/lets-celebrate-hugos-5th-birthday/sunset-get.png
  16. +2 −2 content/en/templates/lookup-order.md
  17. +4 −4 content/en/themes/theme-components.md
  18. +3 −3 layouts/shortcodes/imgproc.html
  19. +5 −5 netlify.toml
  20. BIN ...es/featured-hugo-42-poster_hue0604c0846526b6d2f8ba376edd013b6_74852_480x0_resize_catmullrom_2.png
  21. BIN ...es/featured-hugo-42-poster_hue0604c0846526b6d2f8ba376edd013b6_74852_640x0_resize_catmullrom_2.png
  22. BIN ...gos-5th-birthday/featured_hu30cb938a182ebd06b50ed15d006d8f64_179291_480x0_resize_catmullrom_2.png
  23. BIN ...gos-5th-birthday/featured_hu30cb938a182ebd06b50ed15d006d8f64_179291_640x0_resize_catmullrom_2.png
  24. BIN ...os-5th-birthday/graph-stars_hu169ba15a8bcaf4ddd6a5a1aa8505c448_15599_600x400_fit_catmullrom_2.png
  25. BIN ...s-5th-birthday/graph-themes_hu25707bee0ec3007199f71bb29226f30c_16956_600x400_fit_catmullrom_2.png
  26. BIN ...irthday/sunset-get_hu69849a7cdb847c2393a7b3a7f6061c86_387442_600x300_fill_catmullrom_smart1_2.png
@@ -49,8 +49,10 @@ simple = false
[privacy.twitter]
disable = false
enableDNT = false
simple = false
[privacy.vimeo]
disable = false
simple = false
[privacy.youtube]
disable = false
privacyEnhanced = false
@@ -108,8 +110,25 @@ disableInlineCSS = true
enableDNT
: Enabling this for the twitter/tweet shortcode, the tweet and its embedded page on your site are not used for purposes that include personalized suggestions and personalized ads.
simple
: If simple mode is enabled, a static and no-JS version of a tweet will be built.
**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inlines styles provided by Hugo:
{{< code-toggle file="config">}}
[services]
[services.twitter]
disableInlineCSS = true
{{< /code-toggle >}}
### YouTube
privacyEnhanced
: When you turn on privacy-enhanced mode, YouTube won’t store information about visitors on your website unless the user plays the embedded video.
### Vimeo
simple
: If simple mode is enabled, the video thumbnail is fetched from Vimeo's servers and it is overlayed with a play button. If the user clicks to play the video, it will open in a new tab directly on Vimeo's website.
@@ -35,14 +35,13 @@ help = "Help"
title = "My blog"
weight = 1
[languages.en.params]
linkedin = "english-link"
linkedin = "https://linkedin.com/whoever"
[languages.fr]
copyright = "Tout est à moi"
title = "Mon blog"
title = "Mon blogue"
weight = 2
[languages.fr.params]
linkedin = "lien-francais"
linkedin = "https://linkedin.com/fr/whoever"
[languages.fr.params.navigation]
help = "Aide"
{{< /code-toggle >}}
@@ -55,11 +54,13 @@ and taxonomy pages will be rendered below `/` in English (your default content l
When working with front matter `Params` in [single page templates][singles], omit the `params` in the key for the translation.
If you want all of the languages to be put below their respective language code, enable `defaultContentLanguageInSubdir: true`.
`defaultContentLanguage` sets the project's default language. If not set, the default language will be `en`.
If the default language needs to be rendererd below its own language code (`/en`) like the others, set `defaultContentLanguageInSubdir: true`.
Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc.
## Disable a Language
### Disable a Language
You can disable one or more languages. This can be useful when working on a new translation.
@@ -81,7 +82,7 @@ HUGO_DISABLELANGUAGES=" " hugo server
```
## Configure Multilingual Multihost
### Configure Multilingual Multihost
From **Hugo 0.31** we support multiple languages in a multihost configuration. See [this issue](https://github.com/gohugoio/hugo/issues/4027) for details.
@@ -94,11 +95,11 @@ Example:
{{< code-toggle file="config" >}}
[languages]
[languages.no]
baseURL = "https://example.no"
languageName = "Norsk"
[languages.fr]
baseURL = "https://example.fr"
languageName = "Français"
weight = 1
title = "På norsk"
title = "En Français"
[languages.en]
baseURL = "https://example.com"
@@ -127,7 +128,7 @@ Press Ctrl+C to stop
Live reload and `--navigateToChanged` between the servers work as expected.
## Taxonomies and Blackfriday
### Taxonomies and Blackfriday
Taxonomies and [Blackfriday configuration][config] can also be set per language:
@@ -156,40 +157,113 @@ plaque = "plaques"
## Translate Your Content
Translated articles are identified by the name of the content file.
There are two ways to manage your content translation, both ensures each page is assigned a language and linked to its translations.
### Translation by filename
### Examples of Translated Articles
Considering the following example:
1. `/content/about.en.md`
2. `/content/about.fr.md`
In this example, the `about.md` will be assigned the configured `defaultContentLanguage`.
The first file is assigned the english language and linked to the second.
The second file is assigned the french language and linked to the first.
1. `/content/about.md`
2. `/content/about.fr.md`
Their language is __assigned__ according to the language code added as __suffix to the filename__.
By having the same **path and base filename**, the content pieces are __linked__ together as translated pages.
{{< note >}}
If a file is missing any language code, it will be assigned the default language.
{{</ note >}}
### Translation by content directory
This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` param.
{{< code-toggle file="config" >}}
languages:
en:
weight: 10
languageName: "English"
contentDir: "content/english"
nn:
weight: 20
languageName: "Français"
contentDir: "content/french"
{{< /code-toggle >}}
The value of `contentDir` can be any valid path, even absolute path references. The only restriction is that the content directories cannot overlap.
Considering the following example in conjunction with the configuration above:
1. `/content/english/about.md`
2. `/content/french/about.md`
The first file is assigned the english language and is linked to the second.
<br>The second file is assigned the french language and is linked to the first.
Their language is __assigned__ according to the content directory they are __placed__ in.
By having the same **path and basename** (relative to their language content directory), the content pieces are __linked__ together as translated pages.
This way, you can slowly start to translate your current content without having to rename everything. If left unspecified, the default value for `defaultContentLanguage` is `en`.
### Bypassing default linking.
By having the same **directory and base filename**, the content pieces are linked together as translated pieces.
Any pages sharing the same `translationKey` set in front matter will be linked as translated pages regardless of basename or location.
You can also set the key used to link the translations explicitly in front matter:
Considering the following example:
1. `/content/about-us.en.md`
2. `/content/om.nn.md`
3. `/content/presentation/a-propos.fr.md`
```yaml
translationKey: "my-story"
# set in all three pages
translationKey: "about"
```
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:
By setting the `translationKey` front matter param to `about` in all three pages, they will be __linked__ as translated pages.
```yaml
### Localizing permalinks
Because paths and filenames are used to handle linking, all translated pages, except for the language part, will be sharing the same url.
To localize the URLs, the [`slug`]({{< ref "content-management/organization/index.md#slug" >}}) or [`url`]({{< ref "content-management/organization/index.md#url" >}}) front matter param can be set in any of the non-default language file.
For example, a french translation (`content/about.fr.md`) can have its own localized slug.
{{< code-toggle >}}
Title: A Propos
slug: "a-propos"
{{< /code-toggle >}}
```
At render, Hugo will build both `/about/` and `/a-propos/` as properly linked translated pages.
At render, Hugo will build both `/about/` and `fr/a-propos/` while maintaning their translation linking.
{{% note %}}
If using `url`, remember to include the language part as well: `fr/compagnie/a-propos/`.
{{%/ note %}}
For merging of content from other languages (i.e. missing content translations), see [lang.Merge](/functions/lang.merge/).
### Page Bundles
To avoid the burden of having to duplicate files, each Page Bundle inherits the resources of its linked translated pages' bundles except for the content files (markdown files, html files etc...).
Therefore, from within a template, the page will have access to the files from all linked pages' bundles.
If, across the linked bundles, two or more files share the same basenname, only one will be included and chosen as follows:
* File from current language Bundle, if present.
* First file found across bundles by order of language `Weight`.
{{% note %}}
Page Bundle's resources follow the same language assignement logic as content files, be it by filename (`image.jpg`, `image.fr.jpg`) or by directory (`english/about/header.jpg`, `french/about/header.jpg`).
{{%/ note %}}
## Link to Translated Content
## Reference the Translated Content
To create a list of links to translated content, use a template similar to the following:
@@ -210,7 +284,7 @@ The above can be put in a `partial` (i.e., inside `layouts/partials/`) and inclu
The above also uses the [`i18n` function][i18func] described in the next section.
## List All Available Languages
### List All Available Languages
`.AllTranslations` on a `Page` can be used to list all translations, including itself. Called on the home page it can be used to build a language navigator:
@@ -374,6 +374,10 @@ Using the preceding `youtube` example (without `autoplay="true"`), the following
{{< youtube w7Ft2ymGmfc >}}
## Privacy Config
To learn how to configure your Hugo site to meet the new EU privacy regulation, see [Hugo and the GDPR][].
## Create Custom Shortcodes
To learn more about creating custom shortcodes, see the [shortcode template documentation][].
@@ -382,6 +386,7 @@ To learn more about creating custom shortcodes, see the [shortcode template docu
[contentmanagementsection]: /content-management/formats/
[examplegist]: https://gist.github.com/spf13/7896402
[figureelement]: http://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
[Hugo and the GDPR]: /about/hugo-and-gdpr/
[Instagram]: https://www.instagram.com/
[pagevariables]: /variables/page/
[partials]: /templates/partials/
@@ -72,7 +72,13 @@ pygmentsCodefences
: Set to true to enable syntax highlighting in code fences with a language tag in markdown (see below for an example).
pygmentsStyle
: The style of code highlighting. See https://help.farbox.com/pygments.html for a gallery. Note that this option is not relevant when `pygmentsUseClasses` is set.
: The style of code highlighting. Note that this option is not
relevant when `pygmentsUseClasses` is set.
Syntax highlighting galleries:
**Chroma** ([short snippets](https://xyproto.github.io/splash/docs/all.html),
[long snippets](https://xyproto.github.io/splash/docs/longer/all.html)),
[Pygments](https://help.farbox.com/pygments.html)
pygmentsUseClasses
: Set to `true` to use CSS classes to format your highlighted code. See [Generate Syntax Highlighter CSS](#generate-syntax-highlighter-css).
@@ -1,7 +1,7 @@
---
title: errorf
linktitle: errorf
description: Evaluates a format string and logs it to ERROR.
description: Log ERROR and fail the build from the templates.
date: 2017-09-30
publishdate: 2017-09-30
lastmod: 2017-09-30
@@ -18,9 +18,12 @@ deprecated: false
aliases: []
---
`errorf` will evaluate a format string, then output the result to the ERROR log.
This will also cause the build to fail.
`errorf` will evaluate a format string, then output the result to the ERROR log (and only once per error message to avoid flooding the log).
This will also cause the build to fail (the `hugo` command will `exit -1`).
```
{{ errorf "Something went horribly wrong! %s" err }}
{{ errorf "Failed to handle page %q" .Path }}
```
Note that `errorf` supports all the formatting verbs of the [fmt](https://golang.org/pkg/fmt/) package.
@@ -104,7 +104,7 @@ The most common usage is probably to run `hugo` with your current directory bein
This generates your website to the `public/` directory by default, although you can customize the output directory in your [site configuration][config] by changing the `publishDir` field.
The site Hugo renders into `public/` is ready to be deployed to your web server:
The command `hugo` renders your site into `public/` dir and is ready to be deployed to your web server:
```
hugo
Binary file not shown.
@@ -1,8 +1,8 @@
---
date: 2018-06-12
title: "0.42"
description: "0.42"
title: "Hugo 0.42: Theme Composition and Inheritance!"
description: "Hugo 0.42 adds Theme Components support, a new and powerful way of composing your Hugo sites."
categories: ["Releases"]
---
@@ -1,8 +1,8 @@
---
date: 2018-06-13
title: "0.42.1"
description: "0.42.1"
title: "Hugo 0.42.1: Two Bug Fixes"
description: "Hugo 0.42.1 fixes two issues."
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png
@@ -1,17 +1,16 @@
---
date: 2018-06-28
title: "0.42.2"
description: "0.42.2"
title: "Hugo 0.42.2: One Bug Fix"
description: "Hugo 0.42.2 fixes server reload on config changes."
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png
---
This release fixe broken server-reload on config changes. This is a regression from Hugo `0.42`. [3a7706b0](https://github.com/gohugoio/hugo/commit/3a7706b069107e5fa6112b3f7ce006f16867cb38) [@bep](https://github.com/bep) [#4878](https://github.com/gohugoio/hugo/issues/4878)
This release fixes broken server-reload on config changes. This is a regression from Hugo `0.42`. [3a7706b0](https://github.com/gohugoio/hugo/commit/3a7706b069107e5fa6112b3f7ce006f16867cb38) [@bep](https://github.com/bep) [#4878](https://github.com/gohugoio/hugo/issues/4878)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit bb20442

Please sign in to comment.