Skip to content

Commit b1b401d

Browse files
committed
Updated Insiders changelog and blog plugin documentation
1 parent ab5046d commit b1b401d

File tree

6 files changed

+146
-34
lines changed

6 files changed

+146
-34
lines changed

CHANGELOG

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
mkdocs-material-8.5.3+insiders-4.24.0 (2022-09-27)
2+
3+
* Added support for custom content on index pages (blog)
4+
* Added support for keeping content on paginated index pages (blog)
5+
* Added support for limiting categories in post excerpts (blog)
6+
* Added support for simple override of templates via front matter (blog)
7+
* Added icon in navigation for pages with encrypted content
8+
* Fixed #4396: Front matter of index pages not inherited by pagination (blog)
9+
* Improved performance by building post excerpts once (blog)
10+
111
mkdocs-material-8.5.3+insiders-4.23.6 (2022-09-22)
212

313
* Fixed #4389: Blog posts in first week of year in wrong archive

docs/insiders/changelog.md

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

77
## Material for MkDocs Insiders
88

9+
### 4.24.0 <small>_ September 27, 2022</small> { id="4.24.0" }
10+
11+
- Added support for custom content on index pages (blog)
12+
- Added support for keeping content on paginated index pages (blog)
13+
- Added support for limiting categories in post excerpts (blog)
14+
- Added support for simple override of templates via front matter (blog)
15+
- Added icon in navigation for pages with encrypted content
16+
- Fixed #4396: Front matter of index pages not inherited by pagination (blog)
17+
- Improved performance by building post excerpts once (blog)
18+
919
### 4.23.6 <small>_ September 22, 2022</small> { id="4.23.6" }
1020

1121
- Fixed #4389: Blog posts in first week of year in wrong archive

docs/insiders/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@ 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 21 additional features__ that you can start using right away, and
85+
access to 22 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] [Blog plugin] :material-alert-decagram:{ .mdx-pulse title="Added on September 12, 2022" }
90+
- [x] [Blog plugin: custom index pages] :material-alert-decagram:{ .mdx-pulse title="Added on September 27, 2022" }
9191
- [x] [Blog plugin: related links] :material-alert-decagram:{ .mdx-pulse title="Added on September 12, 2022" }
92+
- [x] [Blog plugin] :material-alert-decagram:{ .mdx-pulse title="Added on September 12, 2022" }
9293
- [x] [Navigation status] :material-alert-decagram:{ .mdx-pulse title="Added on August 21, 2022" }
93-
- [x] [Meta plugin] :material-alert-decagram:{ .mdx-pulse title="Added on July 17, 2022" }
94+
- [x] [Meta plugin]
9495
- [x] [Tags plugin: additional indexes]
9596
- [x] [Document contributors]
9697
- [x] [Automatic light / dark mode]
@@ -286,15 +287,16 @@ are released for general availability.
286287

287288
- [x] [Meta plugin]
288289
- [x] [Blog plugin: related links]
290+
- [x] [Blog plugin: custom index pages]
289291
- [x] [Tags plugin: additional indexes]
290292
- [ ] [Instant previews]
291293
- [ ] Navigation subtitles
292-
- [ ] ... more to be announced
293294

294295
[Meta plugin]: ../reference/index.md#built-in-meta-plugin
295296
[Tags plugin: additional indexes]: ../setup/setting-up-tags.md#+tags.tags_extra_files
296297
[Instant previews]: https://twitter.com/squidfunk/status/1466794654213492743
297298
[Blog plugin: related links]: ../setup/setting-up-a-blog.md#adding-related-links
299+
[Blog plugin: custom index pages]: ../setup/setting-up-a-blog.md#custom-index-pages
298300

299301
### Goals completed
300302

docs/reference/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ within Markdown files.
1111

1212
## Configuration
1313

14-
### Built-in meta plugin :material-alert-decagram:{ .mdx-pulse title="Added on July 17, 2022" }
14+
### Built-in meta plugin
1515

1616
[:octicons-heart-fill-24:{ .mdx-heart } Sponsors only][Insiders]{ .mdx-insiders } ·
1717
[:octicons-tag-24: insiders-4.21.0][Insiders] ·

docs/schema/plugins/blog.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@
113113
],
114114
"default": "optional"
115115
},
116+
"post_excerpt_max_authors": {
117+
"title": "Number of authors to render in post excerpts",
118+
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#+blog.post_excerpt_max_authors",
119+
"type": "number",
120+
"default": 1
121+
},
122+
"post_excerpt_max_categories": {
123+
"title": "Number of categories to render in post excerpts",
124+
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#+blog.post_excerpt_max_categories",
125+
"type": "number",
126+
"default": 5
127+
},
116128
"post_excerpt_separator": {
117129
"title": "Post excerpt separator",
118130
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#+blog.post_excerpt_separator",
@@ -281,6 +293,12 @@
281293
],
282294
"default": "~2~"
283295
},
296+
"pagination_keep_content": {
297+
"title": "Paginated indexes inherit content",
298+
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#+blog.pagination_keep_content",
299+
"type": "boolean",
300+
"default": false
301+
},
284302
"authors": {
285303
"title": "Author info",
286304
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#+blog.authors",
@@ -293,12 +311,6 @@
293311
"type": "string",
294312
"default": ".authors.yml"
295313
},
296-
"authors_in_excerpt": {
297-
"title": "Number of authors to render in post excerpts",
298-
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#+blog.authors_in_excerpt",
299-
"type": "number",
300-
"default": 1
301-
},
302314
"draft": {
303315
"title": "Render posts marked as drafts",
304316
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#+blog.draft",

docs/setup/setting-up-a-blog.md

Lines changed: 101 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,42 @@ The following configuration options are available for posts:
294294
post_excerpt: required
295295
```
296296

297+
[`post_excerpt_max_authors`](#+blog.post_excerpt_max_authors){ #+blog.post_excerpt_max_authors }
298+
299+
: :octicons-milestone-24: Default: `1` – This option specifies the number of
300+
authors rendered in post excerpts. While each post may be written by
301+
multiple authors, this setting allows to limit the display to just a few or
302+
even a single author, or disable authors in excerpts altogether:
303+
304+
=== "Render up to 2 authors in excerpts"
305+
306+
``` yaml
307+
plugins:
308+
- blog:
309+
post_excerpt_max_authors: 2
310+
```
311+
312+
=== "Disable authors in excerpts"
313+
314+
``` yaml
315+
plugins:
316+
- blog:
317+
post_excerpt_max_authors: 0
318+
```
319+
320+
[`post_excerpt_max_categories`](#+blog.post_excerpt_max_categories){ #+blog.post_excerpt_max_categories }
321+
322+
: :octicons-milestone-24: Default: `5` – This option specifies the number of
323+
categories rendered in post excerpts. While each post may be assigned to
324+
multiple categories, the [built-in blog plugin] can be instructed to only
325+
show the first `n` categories to keep it short and concise:
326+
327+
``` yaml
328+
plugins:
329+
- blog:
330+
post_excerpt_max_categories: 5
331+
```
332+
297333
[`post_excerpt_separator`](#+blog.post_excerpt_separator){ #+blog.post_excerpt_separator }
298334

299335
: :octicons-milestone-24: Default: `<!-- more -->` – This option specifies
@@ -634,6 +670,18 @@ The following configuration options are available for index pagination:
634670

635671
[paginate]: https://pypi.org/project/paginate/
636672

673+
[`pagination_keep_content`](#+blog.pagination_keep_content){ #+blog.pagination_keep_content }
674+
675+
: :octicons-milestone-24: Default: `false` – This option specifies whether
676+
paginated index pages should inherit the custom content from the index
677+
page, i.e. the content of `blog/index.md`:
678+
679+
``` yaml
680+
plugins:
681+
- blog:
682+
pagination_keep_content: true
683+
```
684+
637685
#### Authors
638686

639687
The following configuration options are available for author info:
@@ -667,29 +715,6 @@ The following configuration options are available for author info:
667715
The path must be defined relative to [`blog_dir`][this is configurable].
668716
Also see the section on [adding authors].
669717

670-
[`authors_in_excerpt`](#+blog.authors_in_excerpt){ #+blog.authors_in_excerpt }
671-
672-
: :octicons-milestone-24: Default: `1` – This option specifies the number of
673-
authors rendered in post excerpts. While each post may be written by
674-
multiple authors, this setting allows to limit the display to just a few or
675-
even a single author, or disable authors in excerpts altogether:
676-
677-
=== "Render up to 2 authors in excerpts"
678-
679-
``` yaml
680-
plugins:
681-
- blog:
682-
authors_in_excerpt: 2
683-
```
684-
685-
=== "Disable authors in excerpts"
686-
687-
``` yaml
688-
plugins:
689-
- blog:
690-
authors_in_excerpt: 0
691-
```
692-
693718
[adding authors]: #adding-authors
694719

695720
#### Drafts
@@ -1198,6 +1223,59 @@ nav:
11981223

11991224
## Customization
12001225

1226+
### Custom index pages
1227+
1228+
[:octicons-tag-24: insiders-4.24.0][Insiders] ·
1229+
:octicons-beaker-24: Experimental
1230+
1231+
If you want to add custom content to automatically generated [archive] and
1232+
[category] indexes, e.g. to add a category description prior to the list of
1233+
posts, you can manually create the category page in the same location where
1234+
the [built-in blog plugin] would create it:
1235+
1236+
``` sh
1237+
.
1238+
├─ docs/
1239+
│ └─ blog/
1240+
│ ├─ category/
1241+
│ │ └─ hello.md #(1)!
1242+
│ ├─ posts/
1243+
│ └─ index.md
1244+
└─ mkdocs.yml
1245+
```
1246+
1247+
1. The easiest way is to first [add the category] to the blog post, then take
1248+
the URL generated by the [built-in blog plugin] and create the file at the
1249+
corresponding location in the [`blog_dir`][this is configurable] folder.
1250+
1251+
Note that the shown directory listing is based on the default configuration.
1252+
If you specify different values for the following options, be sure to adjust
1253+
the path accordingly:
1254+
1255+
- [`blog_dir`][this is configurable]
1256+
- [`categories_url_format`][categories_url_format]
1257+
- [`categories_slugify`][categories_slugify]
1258+
1259+
You can now add arbitrary content to the newly created file, or set specific
1260+
page properties for this page via front matter, e.g. to change the
1261+
[page description]:
1262+
1263+
``` yaml
1264+
---
1265+
description: Nullam urna elit, malesuada eget finibus ut, ac tortor.
1266+
---
1267+
1268+
# Hello
1269+
...
1270+
```
1271+
1272+
All posts belonging to the category will be automatically appended.
1273+
1274+
[add the category]: #adding-categories
1275+
[page description]: ../reference/index.md#setting-the-page-description
1276+
[categories_url_format]: #+blog.categories_url_format
1277+
[categories_slugify]: #+blog.categories_slugify
1278+
12011279
### Overriding templates
12021280

12031281
The [built-in blog plugin] is built on the same basis as Material for MkDocs,

0 commit comments

Comments
 (0)