mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
@@ -159,6 +159,39 @@ show_comments: false
|
||||
|
||||
Any node or section can pass down to descendents a set of Front Matter values as long as defined underneath the reserved `cascade` Front Matter key.
|
||||
|
||||
### Target Specific Pages
|
||||
|
||||
{{< new-in "0.76.0" >}}
|
||||
|
||||
Since Hugo 0.76 the `cascade` block can be a slice with a optional `_target` keyword, allowing for multiple `cascade` values targeting different page sets.
|
||||
|
||||
{{< code-toggle copy="false" >}}
|
||||
title ="Blog"
|
||||
[[cascade]]
|
||||
background = "yosemite.jpg"
|
||||
[cascade._target]
|
||||
path="/blog/**"
|
||||
lang="en"
|
||||
kind="page"
|
||||
[[cascade]]
|
||||
background = "goldenbridge.jpg"
|
||||
[cascade._target]
|
||||
kind="section"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
Keywords available for `_target`:
|
||||
|
||||
path
|
||||
: A [Glob](https://github.com/gobwas/glob) pattern matching the content path below /content. Expects Unix-styled slashes. Note that this is the virtual path, so it starts at the mount root.
|
||||
|
||||
kind
|
||||
: A Glob pattern matching the Page's Kind(s), e.g. "{home,section}".
|
||||
|
||||
lang
|
||||
: A Glob pattern matching the Page's language, e.g. "{en,sv}".
|
||||
|
||||
Any of the above can be omitted.
|
||||
|
||||
### Example
|
||||
|
||||
In `content/blog/_index.md`
|
||||
@@ -174,6 +207,8 @@ With the above example the Blog section page and its descendents will return `im
|
||||
- Said descendent has its own `banner` value set
|
||||
- Or a closer ancestor node has its own `cascade.banner` value set.
|
||||
|
||||
|
||||
|
||||
## Order Content Through Front Matter
|
||||
|
||||
You can assign content-specific `weight` in the front matter of your content. These values are especially useful for [ordering][ordering] in list views. You can use `weight` for ordering of content and the convention of [`<TAXONOMY>_weight`][taxweight] for ordering content within a taxonomy. See [Ordering and Grouping Hugo Lists][lists] to see how `weight` can be used to organize your content in list views.
|
||||
|
Reference in New Issue
Block a user