Skip to content

Commit e22c6b3

Browse files
committed
Updated Insiders changelog and documentation
1 parent f850edf commit e22c6b3

File tree

6 files changed

+80
-15
lines changed

6 files changed

+80
-15
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
mkdocs-material-8.3.9+insiders-4.21.0 (2022-07-17)
2+
3+
* Added meta plugin: set front matter for all pages in a folder
4+
* Fixed #4114: Tags plugin fails if only tags_extra_files is set
5+
16
mkdocs-material-8.3.9+insiders-4.20.1 (2022-07-11)
27

38
* Fixed #4105: Tags plugin fails if tags_file is not set (4.20.0 regression)

docs/insiders/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ template: overrides/main.html
66

77
## Material for MkDocs Insiders
88

9+
### 4.21.0 <small>_ July 17, 2022</small> { id="4.21.0" }
10+
11+
- Added meta plugin: set front matter for all pages in a folder
12+
- Fixed #4114: Tags plugin fails if only `tags_extra_files` is set
13+
914
### 4.20.1 <small>_ July 11, 2022</small> { id="4.20.1" }
1015

1116
- Fixed #4105: Tags plugin fails if `tags_file` is not set (4.20.0 regression)

docs/insiders/index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ a handful of them, [thanks to our awesome sponsors]!
8282
## What's in for me?
8383

8484
The moment you [become a sponsor][how to become a sponsor], you'll get __immediate
85-
access to 26 additional features__ that you can start using right away, and
85+
access to 27 additional features__ that you can start using right away, and
8686
which are currently exclusively available to sponsors:
8787

8888
<div class="mdx-columns" markdown>
8989

90+
- [x] [Meta plugin] :material-alert-decagram:{ .mdx-pulse title="Added on July 17, 2022" }
9091
- [x] [Additional tags indexes] :material-alert-decagram:{ .mdx-pulse title="Added on July 7, 2022" }
9192
- [x] [Document contributors] :material-alert-decagram:{ .mdx-pulse title="Added on June 24, 2022" }
92-
- [x] [Automatic light / dark mode] :material-alert-decagram:{ .mdx-pulse title="Added on June 11, 2022" }
93+
- [x] [Automatic light / dark mode]
9394
- [x] [Content tabs: anchor links]
9495
- [x] [Navigation pruning]
9596
- [x] [Tooltips]
@@ -304,10 +305,12 @@ are released for general availability.
304305

305306
#### $ 16,000 – Chipotle
306307

308+
- [x] [Meta plugin]
307309
- [x] [Additional tags indexes]
308310
- [ ] [Instant previews]
309311
- [ ] ... more to be announced
310312

313+
[Meta plugin]: ../reference/index.md#built-in-meta-plugin
311314
[Additional tags indexes]: ../setup/setting-up-tags.md#tags-extra-files
312315
[Instant previews]: https://twitter.com/squidfunk/status/1466794654213492743
313316

docs/reference/index.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,45 @@ See additional configuration options:
2727
[front matter]: https://jekyllrb.com/docs/front-matter/
2828
[Metadata]: ../setup/extensions/python-markdown.md#metadata
2929
30+
### Built-in meta plugin :material-alert-decagram:{ .mdx-pulse title="Added on July 17, 2022" }
31+
32+
[:octicons-heart-fill-24:{ .mdx-heart } Sponsors only][Insiders]{ .mdx-insiders } ·
33+
[:octicons-tag-24: insiders-4.21.0][Insiders] ·
34+
:octicons-cpu-24: Plugin ·
35+
:octicons-beaker-24: Experimental
36+
37+
The built-in meta plugin allows to __set front matter per folder__, which is
38+
especially handy to ensure that all pages in a folder use specific templates or
39+
tags. Add the following lines to `mkdocs.yml`:
40+
41+
``` yaml
42+
plugins:
43+
- meta
44+
```
45+
46+
> If you need to be able to build your documentation with and without
47+
> [Insiders], please refer to the [built-in plugins] section to learn how
48+
> shared configurations help to achieve this.
49+
50+
The following configuration options are available:
51+
52+
`meta_file`{ #meta-file }
53+
54+
: :octicons-milestone-24: Default: `**/.meta.yml` – This option specifies the
55+
name of the meta files that the plugin should look for. The default setting
56+
assumes that meta files are called `.meta.yml`:
57+
58+
``` yaml
59+
plugins:
60+
- meta:
61+
meta_file: '**/.meta.yml' # (1)!
62+
```
63+
64+
1. Note that it's strongly recommended to prefix meta files with a `.`,
65+
since otherwise they would be included in the build output.
66+
67+
[built-in plugins]: ../insiders/getting-started.md#built-in-plugins
68+
3069
## Usage
3170

3271
### Setting the page title
@@ -117,7 +156,18 @@ template: custom.html
117156
...
118157
```
119158

159+
??? question "How to set a page template for an entire folder?"
160+
161+
With the help of the [built-in meta plugin], you can set a custom template
162+
for an entire section and all nested pages, by creating a `.meta.yml`
163+
in the corresponding folder with the following content:
164+
165+
``` yaml
166+
template: custom.html
167+
```
168+
120169
[theme extension]: ../customization.md#extending-the-theme
170+
[built-in meta plugin]: #built-in-meta-plugin
121171

122172
## Customization
123173

docs/setup/changing-the-colors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ default color palette.
268268

269269
[palette.media support]: https://github.com/squidfunk/mkdocs-material/releases/tag/7.1.0
270270

271-
#### Automatic light / dark mode :material-alert-decagram:{ .mdx-pulse title="Added on June 11, 2022" }
271+
#### Automatic light / dark mode
272272

273273
[:octicons-heart-fill-24:{ .mdx-heart } Sponsors only][Insiders]{ .mdx-insiders } ·
274274
[:octicons-tag-24: insiders-4.18.0][Insiders] ·
@@ -291,7 +291,7 @@ theme:
291291
292292
# Palette toggle for light mode
293293
- media: "(prefers-color-scheme: light)"
294-
scheme: default #(1)!
294+
scheme: default # (1)!
295295
toggle:
296296
icon: material/brightness-7
297297
name: Switch to dark mode

docs/setup/setting-up-tags.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following configuration options are available:
6060
- tags:
6161
tags_extra_files:
6262
compatibility.md:
63-
- compat #(1)!
63+
- compat # (1)!
6464
web.md:
6565
- html
6666
- js
@@ -185,28 +185,30 @@ tags:
185185
- HTML5
186186
- JavaScript
187187
- CSS
188-
- Other
189188
---
190189
191190
...
192191
```
193192

194193
The page will now render with those tags above the main headline and within the
195-
search preview, which now allows to __find pages by tags__, as shown in the
196-
following screenshots:
194+
search preview, which now allows to __find pages by tags__.
197195

198-
=== "Tags"
196+
??? question "How to set tags for an entire folder?"
199197

200-
[![Tags preview]][Tags preview]
198+
With the help of the [built-in meta plugin], you can ensure that tags are
199+
set for an entire section and all nested pages, by creating a `.meta.yml`
200+
in the corresponding folder with the following content:
201201

202-
=== "Tag search"
203-
204-
[![Tag search preview]][Tag search preview]
202+
``` yaml
203+
tags:
204+
- HTML5
205+
- JavaScript
206+
- CSS
207+
```
205208

206209
[built-in tags plugin]: #built-in-tags-plugin
207210
[Metadata]: extensions/python-markdown.md#metadata
208-
[Tags preview]: ../assets/screenshots/tags.png
209-
[Tag search preview]: ../assets/screenshots/tags-search.png
211+
[built-in meta plugin]: ../reference/index.md#built-in-meta-plugin
210212

211213
### Adding a tags index
212214

0 commit comments

Comments
 (0)