Debian Codegraph @

docs/content/en/configuration/cascade.md

raw
1 ---
2 title: Configure cascade
3 linkTitle: Cascade
4 description: Configure cascade.
5 categories: []
6 keywords: []
7 ---
8
9 {{% glossary-term "cascade" %}}
10
11 > [!NOTE]
12 > You can also configure cascading behavior within a page's front matter. See [details][].
13
14 For example, to cascade the `color` page parameter to all pages:
15
16 {{< code-toggle file=hugo >}}
17 [cascade.params]
18 color = 'red'
19 {{< /code-toggle >}}
20
21 ## Target
22
23 <!-- TODO
24 We deprecated the `_target` front matter key in favor of `target` in v0.156.0 on 2026-02-17. Remove footnote #1 somewhere after v0.171.0, 15 minor releases
25 after deprecation.
26 -->
27
28 The `target` key accepts a [page matcher](g) to limit cascaded values to a subset of pages.[^1] If a target is omitted, values cascade to all pages.
29
30 {{% include "/_common/configuration/page-matcher.md" %}}
31
32 For example, to cascade the `color` page parameter to the `articles` section and its descendants, but only for the English (`en`) and German (`de`) language sites:
33
34 {{< code-toggle file=hugo >}}
35 [cascade.params]
36 color = 'red'
37 [cascade.target]
38 path = '{/articles,/articles/**}'
39 [cascade.target.sites.matrix]
40 languages = '{en,de}'
41 {{< /code-toggle >}}
42
43 ## Array
44
45 Define an array of cascade maps to apply different values to different targets. For example:
46
47 {{< code-toggle file=hugo >}}
48 [[cascade]]
49 [cascade.params]
50 color = 'red'
51 [cascade.target]
52 path = '{/articles,/articles/**}'
53 [[cascade]]
54 [cascade.params]
55 color = 'blue'
56 [cascade.target]
57 path = '{/tutorials,/tutorials/**}'
58 {{< /code-toggle >}}
59
60 [^1]: The `_target` alias for `target` is deprecated and will be removed in a future release.
61
62 [details]: /content-management/front-matter/#cascade-1