Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add description on blog post file/folder naming conventions and date extraction patterns #8845

Merged
merged 2 commits into from Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions website/docs/blog.mdx
Expand Up @@ -144,10 +144,10 @@ module.exports = {

## Blog post date {#blog-post-date}

Docusaurus will extract a `YYYY-MM-DD` date from a file/folder name such as `YYYY-MM-DD-my-blog-post-title.md`.
Docusaurus will extract a `YYYY-MM-DD` date from many patterns such as `YYYY-MM-DD-my-blog-post-title.md` or `YYYY/MM/DD/my-blog-post-title.md`. This enables you to easily group blog posts by year, by month, or to use a flat structure.

<details>
<summary>Example supported patterns</summary>
<summary>Supported date extraction patterns</summary>

| Pattern | Example |
| --- | --- |
Expand All @@ -160,7 +160,7 @@ Docusaurus will extract a `YYYY-MM-DD` date from a file/folder name such as `YYY
| Nested folders + `index.md` | `2021/05/28/my-blog-post-title/index.md` |
| Date in the middle of path | `category/2021/05-28-my-blog-post-title.md` |

The date will be excised from the path and appended to the beginning of the URL slug.
Docusaurus can extract the date from the posts using any of the naming patterns above. It is advisable to choose one pattern and apply it to all posts to avoid confusion.

</details>

Expand Down