From 5ad46d78e0b13afa3a75aab07d9b70af5aaf9c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 16 Mar 2018 09:44:54 +0100 Subject: [PATCH] Merge commit '3886fc1fef6ac19d58b9ba1bb642d0c6c9a54031' --- content/content-management/menus.md | 2 +- content/content-management/multilingual.md | 22 +++++ content/content-management/page-bundles.md | 4 +- content/content-management/sections.md | 45 ++++++---- content/functions/title.md | 2 +- content/getting-started/configuration.md | 85 +++++++++++------- .../getting-started/directory-structure.md | 4 +- content/news/0.30-relnotes-ready.md | 2 +- content/news/0.34-relnotes/index.md | 2 +- content/showcase/forestry/bio.md | 5 ++ content/showcase/forestry/featured.png | Bin 0 -> 227009 bytes content/showcase/forestry/index.md | 48 ++++++++++ content/showcase/letsencrypt/bio.md | 3 + content/showcase/letsencrypt/featured.png | Bin 0 -> 147459 bytes content/showcase/letsencrypt/index.md | 21 +++++ content/templates/introduction.md | 75 +++++++++++++--- content/templates/pagination.md | 10 +-- content/templates/partials.md | 6 +- content/templates/section-templates.md | 31 ++++--- content/tools/search.md | 2 +- ..._227009_1024x512_fill_catmullrom_top_2.png | Bin 0 -> 144909 bytes ...27009_192a300d3ccaa4371c674791fb50a62c.png | Bin 0 -> 45100 bytes ...912a7_227009_640x0_resize_catmullrom_2.png | Bin 0 -> 64714 bytes ..._147459_1024x512_fill_catmullrom_top_2.png | Bin 0 -> 111430 bytes ...e4737_147459_640x0_resize_catmullrom_2.png | Bin 0 -> 50540 bytes ...47459_825bc0f79626434a7ab711238e84984a.png | Bin 0 -> 36458 bytes 26 files changed, 278 insertions(+), 91 deletions(-) create mode 100644 content/showcase/forestry/bio.md create mode 100644 content/showcase/forestry/featured.png create mode 100644 content/showcase/forestry/index.md create mode 100644 content/showcase/letsencrypt/bio.md create mode 100644 content/showcase/letsencrypt/featured.png create mode 100644 content/showcase/letsencrypt/index.md create mode 100644 resources/_gen/images/showcase/forestry/featured_hu77de7d99834fa13b854b7fc62e2912a7_227009_1024x512_fill_catmullrom_top_2.png create mode 100644 resources/_gen/images/showcase/forestry/featured_hu77de7d99834fa13b854b7fc62e2912a7_227009_192a300d3ccaa4371c674791fb50a62c.png create mode 100644 resources/_gen/images/showcase/forestry/featured_hu77de7d99834fa13b854b7fc62e2912a7_227009_640x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/showcase/letsencrypt/featured_hu51cfa254cfc1fb105704d2cdd6ae4737_147459_1024x512_fill_catmullrom_top_2.png create mode 100644 resources/_gen/images/showcase/letsencrypt/featured_hu51cfa254cfc1fb105704d2cdd6ae4737_147459_640x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/showcase/letsencrypt/featured_hu51cfa254cfc1fb105704d2cdd6ae4737_147459_825bc0f79626434a7ab711238e84984a.png diff --git a/content/content-management/menus.md b/content/content-management/menus.md index 26c1eafad..1353ce0e2 100644 --- a/content/content-management/menus.md +++ b/content/content-management/menus.md @@ -151,7 +151,7 @@ menu: {{< /code >}} {{% 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 overide 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`. +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`. {{% /note %}} ## Nesting diff --git a/content/content-management/multilingual.md b/content/content-management/multilingual.md index f9c7a9ba3..eba196c39 100644 --- a/content/content-management/multilingual.md +++ b/content/content-management/multilingual.md @@ -59,6 +59,28 @@ If you want all of the languages to be put below their respective language code, Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc. +## Disable a Language + +You can disable one or more languages. This can be useful when working on a new translation. + +```toml +disableLanguages = ["fr", "jp"] +``` + +Note that you cannot disable the default content language. + +We kept this as a standalone setting to make it easier to set via [OS environment](/getting-started/configuration/#configure-with-environment-variables): + +```bash +HUGO_DISABLELANGUAGES="fr jp" hugo +``` +If you have already a list of disabled languages in `config.toml`, you can enable them in development like this: + +```bash +HUGO_DISABLELANGUAGES=" " hugo server +``` + + ## 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. diff --git a/content/content-management/page-bundles.md b/content/content-management/page-bundles.md index fbb9025ca..f497a59b2 100644 --- a/content/content-management/page-bundles.md +++ b/content/content-management/page-bundles.md @@ -129,9 +129,7 @@ This `_index.md` can also be directly under the `content/` directory. {{% note %}} Here `md` (markdown) is used just as an example. You can use any file -type as a content resource as long as it is a MIME type recognized by -Hugo (`json` files will, as one example, work fine). If you want to -get exotic, you can define your own media type. +type as a content resource as long as it is a content type recognized by Hugo. {{% /note %}} diff --git a/content/content-management/sections.md b/content/content-management/sections.md index 0e167d143..e53e0feb7 100644 --- a/content/content-management/sections.md +++ b/content/content-management/sections.md @@ -17,36 +17,50 @@ aliases: [/content/sections/] toc: true --- +A **Section** is a collection of pages that gets defined based on the +organization structure under the `content/` directory. + +By default, all the **first-level** directories under `content/` form their own +sections (**root sections**). + +If a user needs to define a section `foo` at a deeper level, they need to create +a directory named `foo` with an `_index.md` file (see [Branch Bundles][branch bundles] +for more information). + + +{{% note %}} +A **section** cannot be defined or overridden by a front matter parameter -- it +is strictly derived from the content organization structure. +{{% /note %}} ## Nested Sections The sections can be nested as deeply as you need. ```bash -blog -├── funny-cats -│   └── kittens -│   └── _index.md -└── tech - └── _index.md +content +└── blog <-- Section, because first-level dir under content/ + ├── funny-cats + │   ├── mypost.md + │   └── kittens <-- Section, because contains _index.md + │   └── _index.md + └── tech <-- Section, because contains _index.md + └── _index.md ``` - -**The important part to understand is, that to make the section tree fully navigational, at least the lower-most section needs a content file. (e.g. `_index.md`).** - +**The important part to understand is, that to make the section tree fully navigational, at least the lower-most section needs a content file. (e.g. `_index.md`).** {{% note %}} -When we talk about a **section** in correlation with template selection, it is currently always the root section only (`/blog/funny/mypost/ => blog`). +When we talk about a **section** in correlation with template selection, it is +currently always the *root section* only (`/blog/funny-cats/mypost/ => blog`). If you need a specific template for a sub-section, you need to adjust either the `type` or `layout` in front matter. {{% /note %}} - ## Example: Breadcrumb Navigation With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation: - {{< code file="layouts/partials/breadcrumb.html" download="breadcrumb.html" >}}