Blog Plugin
Basic usage¶
First, ensure your blog posts are defined in the table of contents of your myst.yml file:
project:
toc:
- pattern: posts/**/*.mdList the blog posts in a folder with the following directive:
% By default, the plugin looks for markdown files in a `posts` directory
:::{blog-posts}
:::Hello again!
I’m also a blog post
Hello world!
I’m a blog post
Custom paths with glob patterns¶
The :path: option supports glob patterns, allowing you to organize posts in subfolders. For example, to include all markdown files in any subfolder:
This is useful when organizing posts by year or category:
posts/2024/post-one.md
posts/2025/post-two.mdLimit the number of posts¶
You can limit the number of posts displayed:
:::{blog-posts}
:limit: 1
:path: posts/**/*.md
:::A newer post from 2025
Also in a subfolder
This post demonstrates glob patterns working with subfolders.
Table view¶
For blogs with many posts, you can use a more compact table layout instead of cards:
:::{blog-posts}
:kind: table
:path: posts/**/*.md
:::| Title | Date |
|---|---|
| A newer post from 2025 | 2025-03-01 |
| Hello again! | 2025-02-01 |
| Hello world! | 2025-01-01 |
| An older post from 2024 | 2024-12-15 |
By default, the table displays title and date columns. The title column is automatically linked to the post.
Custom table columns¶
You can customize which frontmatter fields to display as columns using the :table-columns: option:
:::{blog-posts}
:kind: table
:table-columns: title, date, subtitle
:path: posts/**/*.md
:::| Title | Date | Subtitle |
|---|---|---|
| A newer post from 2025 | 2025-03-01 | Also in a subfolder |
| Hello again! | 2025-02-01 | I'm also a blog post |
| Hello world! | 2025-01-01 | I'm a blog post |
| An older post from 2024 | 2024-12-15 | Testing subfolder organization |
Or reverse the date:
:::{blog-posts}
:kind: table
:table-columns: date, title, subtitle
:path: posts/**/*.md
:::| Date | Title | Subtitle |
|---|---|---|
| 2025-03-01 | A newer post from 2025 | Also in a subfolder |
| 2025-02-01 | Hello again! | I'm also a blog post |
| 2025-01-01 | Hello world! | I'm a blog post |
| 2024-12-15 | An older post from 2024 | Testing subfolder organization |
Any frontmatter field can be used as a column!
Sorting posts¶
You can customize sorting with the :sort: option. This takes a form like:
:::{blog-posts]
:sort: [column]-[asc/desc]
:::Where [column] is a field in each post’s YAML metadata, and asc/desc corresponds to alphanumeric sort ascending or descending. Omitting the -[asc/desc] will default to -asc. For example:
:::{blog-posts}
:sort: title
:kind: table
:path: posts/**/*.md
:::| Title | Date |
|---|---|
| A newer post from 2025 | 2025-03-01 |
| An older post from 2024 | 2024-12-15 |
| Hello again! | 2025-02-01 |
| Hello world! | 2025-01-01 |
:::{blog-posts}
:sort: title-desc
:kind: table
:path: posts/**/*.md
:::| Title | Date |
|---|---|
| Hello world! | 2025-01-01 |
| Hello again! | 2025-02-01 |
| An older post from 2024 | 2024-12-15 |
| A newer post from 2025 | 2025-03-01 |
Posts with missing values for the sort field are placed at the end.