From 35febb2e2a3780c3338a2665fddea7dda28a17f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 15 Jul 2019 23:49:41 +0200 Subject: [PATCH] Squashed 'docs/' changes from 0c3c04fd6..540aeddc7 540aeddc7 Small fixes for Open Graph internal template 47bbb3fd7 Bump lodash.template from 4.4.0 to 4.5.0 in /themes/gohugoioTheme 64c1cc3db Update title.md 36c27be37 Update configuration.md 4627cfe9a added commento.io to the list 341d9d945 Fix link to font assets 4a6876dec Small typo fix in configuration.md 736d6ddd7 Add bypasscensorship.org showcase. de7ab636b Use actual width in image processing examples 6c88ab2da Update directory-structure.md 88f559e81 Fix spelling mistakes 7bd427141 Rephrase four points from Hosting on Github docs bce1b1832 Fix typos for absLangURL and relLangURL functions abab57335 Update directory-structure.md a6716f2ed Fix metadata list 5ef61d912 Fix typo d9e467b8b Actuall show how to generate pages in quickstart 0aadc92e7 Update link to issue theme submission b1902faaa Remove incorrect note about Hugo snap --classic use. d451e7362 Update documentation on page variables ab2233c39 Update publish_to_ghpages.sh 7c120346b Fix typo in syntax highlighting page. f01dc555d Correct some typos be825ade9 Videos plural produces og:video bc962fbdf Updated installing.md file to include linuxbrew installation 08c9f8fc8 Mention 1 MB file size limit in readFile doc 7145e29e2 Fixes bad URL in menus.md for .hasChildren * part of issue #814 0edbd59c4 add warning about .Hugo variable being deprecated 77f74ced5 fix: typo in output-formats.md f71b67f34 Correct typo "RFC339" to "RFC1123Z" (#837) 424c0207a baseurl -> baseURL f4e24a03e Render launched; no invite code needed 37e1101d3 Add Render hosting guide 01d0a6481 Bump js-yaml from 3.12.0 to 3.13.1 in /themes/gohugoioTheme edb7b36b0 Link site hierarchy schema to larger version af72acda0 Fixes typo in fingerprint.md 0a738467b Adding required XML tag to sample templates 52211f656 Remove note that XML declaration is not needed a39b9ac87 Adding required XML tag to sample templates 1a44d8a50 Add configuration information for Azure 5b7c6b5a1 remove google plus 5a64301ba HTTPS link to yaml.org/spec/ git-subtree-dir: docs git-subtree-split: 540aeddc797658a2c3d0e49e944592d2b23b3bb8 --- content/en/content-management/authors.md | 5 +- content/en/content-management/comments.md | 1 + content/en/content-management/multilingual.md | 73 +++++++------- .../content-management/organization/index.md | 2 +- content/en/content-management/related.md | 14 +-- .../content-management/syntax-highlighting.md | 2 +- content/en/contribute/themes.md | 2 +- content/en/functions/format.md | 5 +- content/en/functions/readfile.md | 2 + content/en/functions/templates.Exists.md | 4 +- content/en/functions/title.md | 4 + content/en/getting-started/configuration.md | 11 ++- .../en/getting-started/directory-structure.md | 7 +- content/en/getting-started/installing.md | 13 ++- content/en/getting-started/quick-start.md | 25 ++++- .../hosting-on-github.md | 21 ++-- .../hosting-on-render.md | 93 ++++++++++++++++++ content/en/hugo-pipes/fingerprint.md | 4 +- content/en/news/0.14-relnotes/index.md | 2 +- content/en/news/0.52-relnotes/index.md | 37 +++---- content/en/showcase/arolla-cocoon/index.md | 4 +- content/en/showcase/bypasscensorship/bio.md | 6 ++ .../en/showcase/bypasscensorship/featured.png | Bin 0 -> 180903 bytes content/en/showcase/bypasscensorship/index.md | 24 +++++ content/en/showcase/pharmaseal/bio.md | 2 +- content/en/templates/404.md | 1 + content/en/templates/internal.md | 8 +- content/en/templates/introduction.md | 4 +- content/en/templates/lists.md | 2 +- content/en/templates/menu-templates.md | 2 +- content/en/templates/output-formats.md | 2 +- content/en/templates/rss.md | 8 +- content/en/templates/sitemap-template.md | 9 +- content/en/variables/hugo.md | 5 + content/en/variables/menus.md | 2 +- content/en/variables/page.md | 9 ++ layouts/shortcodes/imgproc.html | 2 +- ..._180903_1024x512_fill_catmullrom_top_2.png | Bin 0 -> 190774 bytes ...f80c1_180903_640x0_resize_catmullrom_2.png | Bin 0 -> 113241 bytes ...80903_d94e4c803eac4491bc295665908df904.png | Bin 0 -> 68464 bytes .../layouts/_default/baseof.html | 6 +- themes/gohugoioTheme/package-lock.json | 75 ++++++++------ 42 files changed, 344 insertions(+), 154 deletions(-) create mode 100644 content/en/hosting-and-deployment/hosting-on-render.md create mode 100644 content/en/showcase/bypasscensorship/bio.md create mode 100644 content/en/showcase/bypasscensorship/featured.png create mode 100644 content/en/showcase/bypasscensorship/index.md create mode 100644 resources/_gen/images/showcase/bypasscensorship/featured_hu3be69425780460f51f7c2367ed0f80c1_180903_1024x512_fill_catmullrom_top_2.png create mode 100644 resources/_gen/images/showcase/bypasscensorship/featured_hu3be69425780460f51f7c2367ed0f80c1_180903_640x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/showcase/bypasscensorship/featured_hu3be69425780460f51f7c2367ed0f80c1_180903_d94e4c803eac4491bc295665908df904.png diff --git a/content/en/content-management/authors.md b/content/en/content-management/authors.md index 530557ac0..4cec5281a 100644 --- a/content/en/content-management/authors.md +++ b/content/en/content-management/authors.md @@ -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: diff --git a/content/en/content-management/comments.md b/content/en/content-management/comments.md index dad5d0786..0034309f5 100644 --- a/content/en/content-management/comments.md +++ b/content/en/content-management/comments.md @@ -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) diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index bd9bd97d7..49565d948 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -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. - +If a file has no language code, it will be assigned the default language. {{}} + ### 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,22 +190,22 @@ 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. -
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. @@ -213,7 +213,7 @@ By having the same **path and basename** (relative to their language content dir ### 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,11 +231,11 @@ 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 @@ -243,9 +243,10 @@ 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
  • {{ .Lang }}: {{ .Title }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}
  • - {{ end}} + {{ end }} {{ 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//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 -