Skip to content

Commit f494840

Browse files
squidfunkBizordec
andcommitted
Documented for scope setting
Co-authored-by: Bizordec <25798995+Bizordec@users.noreply.github.com>
1 parent bb6c698 commit f494840

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/setup/building-an-optimized-site.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,51 @@ For a list of all settings, please consult the [plugin documentation].
4242
so that we can improve it together with our users and make it even more
4343
powerful as we discover new use cases.
4444
45+
#### Scope
46+
47+
<!-- md:version 8.0.0 -->
48+
<!-- md:default none -->
49+
50+
There might be a use case, where you want to share user-level settings like
51+
the selected [color palette], or [cookie consent] across all projects. To do
52+
so, add the following lines to `mkdocs.yml`:
53+
54+
``` yaml
55+
extra:
56+
scope: /
57+
```
58+
59+
!!! example "How it works"
60+
61+
Suppose you have this site structure:
62+
```
63+
.
64+
└── /
65+
├── subsite-a/
66+
├── subsite-b/
67+
└── subsite-c/
68+
```
69+
By default, each site will have its own scope (`/subsite-a/`, `/subsite-b/`,
70+
`/subsite-c/`). To modify this behaviour, add the following lines to
71+
`mkdocs.yml`:
72+
73+
``` yaml
74+
extra:
75+
scope: /
76+
```
77+
78+
By setting it to `/`, it should allow you to share the following preferences
79+
across the main site and all subsites:
80+
81+
- [Cookie consent][cookie consent]
82+
- [Linking of content tabs, i.e. active tab]
83+
- [Color palette][color palette]
84+
85+
[Scope support]: https://github.com/squidfunk/mkdocs-material/releases/tag/8.0.0
86+
[cookie consent]: ../setup/ensuring-data-privacy.md#cookie-consent
87+
[Linking of content tabs, i.e. active tab]: ../reference/content-tabs.md
88+
[color palette]: ../setup/changing-the-colors.md#color-palette
89+
4590
### Built-in optimize plugin
4691

4792
<!-- md:sponsors -->

0 commit comments

Comments
 (0)