Skip to content
Permalink
Browse files

Squashed 'docs/' changes from 0c3c04f..540aedd

540aedd Small fixes for Open Graph internal template
47bbb3f Bump lodash.template from 4.4.0 to 4.5.0 in /themes/gohugoioTheme
64c1cc3 Update title.md
36c27be Update configuration.md
4627cfe added commento.io to the list
341d9d9 Fix link to font assets
4a6876d Small typo fix in configuration.md
736d6dd Add bypasscensorship.org showcase.
de7ab63 Use actual width in image processing examples
6c88ab2 Update directory-structure.md
88f559e Fix spelling mistakes
7bd4271 Rephrase four points from Hosting on Github docs
bce1b18 Fix typos for absLangURL and relLangURL functions
abab573 Update directory-structure.md
a6716f2 Fix metadata list
5ef61d9 Fix typo
d9e467b Actuall show how to generate pages in quickstart
0aadc92 Update link to issue theme submission
b1902fa Remove incorrect note about Hugo snap --classic use.
d451e73 Update documentation on page variables
ab2233c Update publish_to_ghpages.sh
7c12034 Fix typo in syntax highlighting page.
f01dc55 Correct some typos
be825ad Videos plural produces og:video
bc962fb Updated installing.md file to include linuxbrew installation
08c9f8f Mention 1 MB file size limit in readFile doc
7145e29 Fixes bad URL in menus.md for .hasChildren * part of issue #814
0edbd59 add warning about .Hugo variable being deprecated
77f74ce fix: typo in output-formats.md
f71b67f Correct typo "RFC339" to "RFC1123Z" (#837)
424c020 baseurl -> baseURL
f4e24a0 Render launched; no invite code needed
37e1101 Add Render hosting guide
01d0a64 Bump js-yaml from 3.12.0 to 3.13.1 in /themes/gohugoioTheme
edb7b36 Link site hierarchy schema to larger version
af72acd Fixes typo in fingerprint.md
0a73846 Adding required XML tag to sample templates
52211f6 Remove note that XML declaration is not needed
a39b9ac Adding required XML tag to sample templates
1a44d8a Add configuration information for Azure
5b7c6b5 remove google plus
5a64301 HTTPS link to yaml.org/spec/

git-subtree-dir: docs
git-subtree-split: 540aedd
  • Loading branch information...
bep committed Jul 15, 2019
1 parent be04ece commit 35febb2e2a3780c3338a2665fddea7dda28a17f4
Showing with 344 additions and 154 deletions.
  1. +2 −3 content/en/content-management/authors.md
  2. +1 −0 content/en/content-management/comments.md
  3. +35 −38 content/en/content-management/multilingual.md
  4. +1 −1 content/en/content-management/organization/index.md
  5. +7 −7 content/en/content-management/related.md
  6. +1 −1 content/en/content-management/syntax-highlighting.md
  7. +1 −1 content/en/contribute/themes.md
  8. +4 −1 content/en/functions/format.md
  9. +2 −0 content/en/functions/readfile.md
  10. +2 −2 content/en/functions/templates.Exists.md
  11. +4 −0 content/en/functions/title.md
  12. +9 −2 content/en/getting-started/configuration.md
  13. +3 −4 content/en/getting-started/directory-structure.md
  14. +12 −1 content/en/getting-started/installing.md
  15. +24 −1 content/en/getting-started/quick-start.md
  16. +10 −11 content/en/hosting-and-deployment/hosting-on-github.md
  17. +93 −0 content/en/hosting-and-deployment/hosting-on-render.md
  18. +2 −2 content/en/hugo-pipes/fingerprint.md
  19. +1 −1 content/en/news/0.14-relnotes/index.md
  20. +16 −21 content/en/news/0.52-relnotes/index.md
  21. +2 −2 content/en/showcase/arolla-cocoon/index.md
  22. +6 −0 content/en/showcase/bypasscensorship/bio.md
  23. BIN content/en/showcase/bypasscensorship/featured.png
  24. +24 −0 content/en/showcase/bypasscensorship/index.md
  25. +1 −1 content/en/showcase/pharmaseal/bio.md
  26. +1 −0 content/en/templates/404.md
  27. +6 −2 content/en/templates/internal.md
  28. +2 −2 content/en/templates/introduction.md
  29. +1 −1 content/en/templates/lists.md
  30. +1 −1 content/en/templates/menu-templates.md
  31. +1 −1 content/en/templates/output-formats.md
  32. +1 −7 content/en/templates/rss.md
  33. +2 −7 content/en/templates/sitemap-template.md
  34. +5 −0 content/en/variables/hugo.md
  35. +1 −1 content/en/variables/menus.md
  36. +9 −0 content/en/variables/page.md
  37. +1 −1 layouts/shortcodes/imgproc.html
  38. BIN ...scensorship/featured_hu3be69425780460f51f7c2367ed0f80c1_180903_1024x512_fill_catmullrom_top_2.png
  39. BIN ...bypasscensorship/featured_hu3be69425780460f51f7c2367ed0f80c1_180903_640x0_resize_catmullrom_2.png
  40. BIN ...ensorship/featured_hu3be69425780460f51f7c2367ed0f80c1_180903_d94e4c803eac4491bc295665908df904.png
  41. +3 −3 themes/gohugoioTheme/layouts/_default/baseof.html
  42. +47 −28 themes/gohugoioTheme/package-lock.json
@@ -44,7 +44,6 @@ weight = 10
[social]
facebook = "alice.allison"
twitter = "alice"
googleplus = "aliceallison1"
website = "www.example.com"
[params]
@@ -108,9 +107,9 @@ You can find a list of all template variables to access the profile information
### Link Social Network Accounts
As aforementioned, Hugo is able to generate links to profiles of the most popular social networks. The following social networks with their corrersponding identifiers are supported: `github`, `facebook`, `twitter`, `googleplus`, `pinterest`, `instagram`, `youtube` and `linkedin`.
As aforementioned, Hugo is able to generate links to profiles of the most popular social networks. The following social networks with their corrersponding identifiers are supported: `github`, `facebook`, `twitter`, `pinterest`, `instagram`, `youtube` and `linkedin`.
This is can be done with the `.Social.URL` function. Its only parameter is the name of the social network as they are defined in the profile (e.g. `facebook`, `googleplus`). Custom variables like `website` remain as they are.
This is can be done with the `.Social.URL` function. Its only parameter is the name of the social network as they are defined in the profile (e.g. `facebook`, `twitter`). Custom variables like `website` remain as they are.
Most articles feature a small section with information about the author at the end. Let's create one containing the author's name, a thumbnail, a (summarized) biography and links to all social networks:
@@ -61,6 +61,7 @@ There are a few alternatives to commenting on static sites for those who do not
* [Tutorial on Implementing Isso with Hugo][issotutorial]
* [Utterances](https://utteranc.es/) (Open source, Github comments widget built on Github issues)
* [Remark](https://github.com/umputun/remark) (Open source, Golang, Easy to run docker)
* [Commento](https://commento.io/) (Open Source, available as a service, local install, or docker image)

<!-- I don't think this is worth including in the documentation since it seems that Steve is no longer supporting or developing this project. rdwatters - 2017-02-29.-->
<!-- * [Kaiju](https://github.com/spf13/kaiju) -->
@@ -49,7 +49,7 @@ linkedin = "https://linkedin.com/fr/whoever"
help = "Aide"
{{< /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). This also works for `params`, as demonstrated with `help` above: you will get the value `Aide` in French and `Help` in all the languages without this parameter set.
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). This also works for `params`, as demonstrated witgh `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set.

With the configuration above, all content, sitemap, RSS feeds, paginations,
and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
@@ -159,7 +159,7 @@ plaque = "plaques"

## Translate Your Content

There are two ways to manage your content translation, both ensures each page is assigned a language and linked to its translations.
There are two ways to manage your content translations. Both ensure each page is assigned a language and is linked to its counterpart translations.

### Translation by filename

@@ -168,17 +168,17 @@ Considering the following example:
1. `/content/about.en.md`
2. `/content/about.fr.md`

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.
The first file is assigned the English language and is linked to the second.
The second file is assigned the French language and is linked to the first.

Their language is __assigned__ according to the language code added as __suffix to the filename__.
Their language is __assigned__ according to the language code added as a __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 >}}
If a file has no 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.
@@ -190,30 +190,30 @@ languages:
weight: 10
languageName: "English"
contentDir: "content/english"
nn:
fr:
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.
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.
The first file is assigned the English language and is linked to the second.
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.

### Bypassing default linking.

Any pages sharing the same `translationKey` set in front matter will be linked as translated pages regardless of basename or location.
Any pages sharing the same `translationKey` set in front matter will be linked as translated pages regardless of basename or location.

Considering the following example:

@@ -231,21 +231,22 @@ By setting the `translationKey` front matter param to `about` in all three pages

### 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.
Because paths and filenames are used to handle linking, all translated pages will share the same URL (apart from the language subdirectory).

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.
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 `fr/a-propos/` while maintaning their translation linking.
At render, Hugo will build both `/about/` and `/fr/a-propos/` while maintaining their translation linking.

{{% note %}}
If using `url`, remember to include the language part as well: `fr/compagnie/a-propos/`.
If using `url`, remember to include the language part as well: `/fr/compagnie/a-propos/`.
{{%/ note %}}

### Page Bundles
@@ -254,15 +255,13 @@ To avoid the burden of having to duplicate files, each Page Bundle inherits the

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:
If, across the linked bundles, two or more files share the same basename, only one will be included and chosen as follows:

* File from current language Bundle, if present.
* 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`).

Page Bundle resources follow the same language assignment logic as content files, both by filename (`image.jpg`, `image.fr.jpg`) and by directory (`english/about/header.jpg`, `french/about/header.jpg`).
{{%/ note %}}

## Reference the Translated Content
@@ -277,18 +276,18 @@ To create a list of links to translated content, use a template similar to the f
<li>
<a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}</a>
</li>
{{ end}}
{{ end }}
</ul>
{{ end }}
{{< /code >}}

The above can be put in a `partial` (i.e., inside `layouts/partials/`) and included in any template, be it for a [single content page][contenttemplate] or the [homepage][]. It will not print anything if there are no translations for a given page.
The above can be put in a `partial` (i.e., inside `layouts/partials/`) and included in any template, whether a [single content page][contenttemplate] or the [homepage][]. It will not print anything if there are no translations for a given page.

The above also uses the [`i18n` function][i18func] described in the next section.

### 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:
`.AllTranslations` on a `Page` can be used to list all translations, including the page itself. On the home page it can be used to build a language navigator:


{{< code file="layouts/partials/allLanguages.html" >}}
@@ -306,7 +305,7 @@ Hugo uses [go-i18n][] to support string translations. [See the project's source
Translations are collected from the `themes/<THEME>/i18n/` folder (built into the theme), as well as translations present in `i18n/` at the root of your project. In the `i18n`, the translations will be merged and take precedence over what is in the theme folder. Language files should be named according to [RFC 5646][] with names such as `en-US.toml`, `fr.toml`, etc.

{{% note %}}
From **Hugo 0.31** you no longer need to use a valid language code. It _can be_ anything.
From **Hugo 0.31** you no longer need to use a valid language code. It can be anything.

See https://github.com/gohugoio/hugo/issues/3564

@@ -341,8 +340,8 @@ An example of singular and plural form:

```
[readingTime]
one = "One minute read"
other = "{{.Count}} minutes read"
one = "One minute to read"
other = "{{.Count}} minutes to read"
```
And then in the template:

@@ -352,7 +351,7 @@ And then in the template:

## Customize Dates

At the time of this writing, Go does not yet have support for internationalized locales, but if you do some work, you can simulate it. For example, if you want to use French month names, you can add a data file like ``data/mois.yaml`` with this content:
At the time of this writing, Go does not yet have support for internationalized locales for dates, but if you do some work, you can simulate it. For example, if you want to use French month names, you can add a data file like ``data/mois.yaml`` with this content:

~~~yaml
1: "janvier"
@@ -369,10 +368,10 @@ At the time of this writing, Go does not yet have support for internationalized
12: "décembre"
~~~

... then index the non-English date names in your templates like so:
...then index the non-English date names in your templates like so:

~~~html
<time class="post-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
<time class="post-date" datetime="{{ .Date.Format '2006-01-02T15:04:05Z07:00' | safeHTML }}">
Article publié le {{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }} (dernière modification le {{ .Lastmod.Day }} {{ index $.Site.Data.mois (printf "%d" .Lastmod.Month) }} {{ .Lastmod.Year }})
</time>
~~~
@@ -381,7 +380,7 @@ This technique extracts the day, month and year by specifying ``.Date.Day``, ``.

## Menus

You can define your menus for each language independently. The [creation of a menu][menus] works analogous to earlier versions of Hugo, except that they have to be defined in their language-specific block in the configuration file:
You can define your menus for each language independently. Creating multilingual menus works just like [creating regular menus][menus], except they're defined in language-specific blocks in the configuration file:

```
defaultContentLanguage = "en"
@@ -406,7 +405,7 @@ name = "Startseite"
weight = 0
```

The rendering of the main navigation works as usual. `.Site.Menus` will just contain the menu of the current language. Pay attention to the generation of the menu links. `absLangURL` takes care that you link to the correct locale of your website. Otherwise, both menu entries would link to the English version as the default content language that resides in the root directory.
The rendering of the main navigation works as usual. `.Site.Menus` will just contain the menu in the current language. Note that `absLangURL` below will link to the correct locale of your website. Without it, menu entries in all languages would link to the English version, since it's the default content language that resides in the root directory.

```
<ul>
@@ -427,7 +426,7 @@ If a string does not have a translation for the current language, Hugo will use
While translating a Hugo website, it can be handy to have a visual indicator of missing translations. The [`enableMissingTranslationPlaceholders` configuration option][config] will flag all untranslated strings with the placeholder `[i18n] identifier`, where `identifier` is the id of the missing translation.

{{% note %}}
Hugo will generate your website with these missing translation placeholders. It might not be suited for production environments.
Hugo will generate your website with these missing translation placeholders. It might not be suitable for production environments.
{{% /note %}}

For merging of content from other languages (i.e. missing content translations), see [lang.Merge](/functions/lang.merge/).
@@ -444,11 +443,9 @@ i18n|MISSING_TRANSLATION|en|wordCount
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:

* Come from the built-in `.Permalink` or `.RelPermalink`
* Be constructed with
* The [`relLangURL` template function][rellangurl] or the [`absLangURL` template function][abslangurl] **OR**
* Prefixed with `{{ .LanguagePrefix }}`
* Be constructed with the [`relLangURL` template function][rellangurl] or the [`absLangURL` template function][abslangurl] **OR** be prefixed with `{{ .LanguagePrefix }}`

If there is more than one language defined, the `LanguagePrefix` variable will equal `/en` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string and is therefore harmless for single-language Hugo websites.
If there is more than one language defined, the `LanguagePrefix` variable will equal `/en` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string (and is therefore harmless for single-language Hugo websites).

[abslangurl]: /functions/abslangurl
[config]: /getting-started/configuration/
@@ -60,7 +60,7 @@ Without any additional configuration, the following will just work:
## Path Breakdown in Hugo


The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseurl = "https://example.com"` in your [site's configuration file][config].
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseURL = "https://example.com"` in your [site's configuration file][config].

### Index Pages: `_index.md`

@@ -15,12 +15,12 @@ toc: true
---


Hugo uses a set of factors to identify a page's related content based on Front Matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content).
Hugo uses a set of factors to identify a page's related content based on Front Matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content).

## List Related Content


To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template:
To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template:

{{< code file="layouts/partials/related.html" >}}
{{ $related := .Site.RegularPages.Related . | first 5 }}
@@ -53,9 +53,9 @@ Returns a collection of pages related to a given one restricted to a list of ind
```

#### .RelatedTo KEYVALS [KEYVALS2 ...]
Returns a collection of pages related together by a set of indices and their match.
Returns a collection of pages related together by a set of indices and their match.

In order to build those set and pass them as argument, one must use the `keyVals` function where the first agrument would be the `indice` and the consective ones its potential `matches`.
In order to build those set and pass them as argument, one must use the `keyVals` function where the first argument would be the `indice` and the consective ones its potential `matches`.

```
{{ $related := .Site.RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }}
@@ -104,7 +104,7 @@ toLower
### Config Options per Index

name
: The index name. This value maps directly to a page param. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
: The index name. This value maps directly to a page param. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.

weight
: An integer weight that indicates _how important_ this parameter is relative to the other parameters. It can be 0, which has the effect of turning this index off, or even negative. Test with different values to see what fits your content best.
@@ -117,13 +117,13 @@ toLower

## Performance Considerations

**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.
**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.

This feature has been in the back log and requested by many for a long time. The development got this recent kick start from this Twitter thread:

{{< tweet 898398437527363585 >}}

Scott S. Lowe removed the "Related Content" section built using the `intersect` template function on tags, and the build time dropped from 30 seconds to less than 2 seconds on his 1700 content page sized blog.
Scott S. Lowe removed the "Related Content" section built using the `intersect` template function on tags, and the build time dropped from 30 seconds to less than 2 seconds on his 1700 content page sized blog.

He should now be able to add an improved version of that "Related Content" section without giving up the fast live-reloads. But it's worth noting that:

0 comments on commit 35febb2

Please sign in to comment.
You can’t perform that action at this time.