From a9edd6fa083873d5c2d847f04a653490f7cae298 Mon Sep 17 00:00:00 2001 From: Chua Chee How Date: Wed, 29 Mar 2023 23:15:58 +0800 Subject: [PATCH 1/2] Add description on file/folder naming strategy Provide a clearer explanation that Docusaurus supports many different file/folder naming strategy that users can adopt for date extraction while retaining flexibility in how the files and folders can be structured. --- website/docs/blog.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/docs/blog.mdx b/website/docs/blog.mdx index 02f870da6f6f..5591df9dce38 100644 --- a/website/docs/blog.mdx +++ b/website/docs/blog.mdx @@ -146,8 +146,10 @@ module.exports = { Docusaurus will extract a `YYYY-MM-DD` date from a file/folder name such as `YYYY-MM-DD-my-blog-post-title.md`. +There are a variety of patterns of file/folder structure from which Docusaurus can extract the date. For example, posts can be placed into folders named by year, and the files inside be named from the month onwards. (See "Supported date extraction patterns" below.) This flexible pattern extraction method is a powerful way to manage large numbers of posts in your folder. +
-Example supported patterns +Supported date extraction patterns | Pattern | Example | | --- | --- | @@ -160,7 +162,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.
From 88db7f7feaf0d9a7100b13f0c0372300905aee1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 6 Apr 2023 15:42:34 +0200 Subject: [PATCH 2/2] Update website/docs/blog.mdx --- website/docs/blog.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/website/docs/blog.mdx b/website/docs/blog.mdx index 5591df9dce38..b6a3f53d670e 100644 --- a/website/docs/blog.mdx +++ b/website/docs/blog.mdx @@ -144,9 +144,7 @@ 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`. - -There are a variety of patterns of file/folder structure from which Docusaurus can extract the date. For example, posts can be placed into folders named by year, and the files inside be named from the month onwards. (See "Supported date extraction patterns" below.) This flexible pattern extraction method is a powerful way to manage large numbers of posts in your folder. +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.
Supported date extraction patterns