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" >}}