mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 10:22:30 +02:00
feat(content-blog): parse date from middle of file path (#6245)
This commit is contained in:
parent
29ecf22409
commit
d133910cb2
6 changed files with 44 additions and 18 deletions
|
@ -78,14 +78,18 @@ This naming convention is optional, and you can provide the date as front matter
|
|||
<details>
|
||||
<summary>Example supported patterns</summary>
|
||||
|
||||
- `2021-05-28-my-blog-post-title.md`
|
||||
- `2021-05-28-my-blog-post-title.mdx`
|
||||
- `2021-05-28-my-blog-post-title/index.md`
|
||||
- `2021-05-28/my-blog-post-title.md`
|
||||
- `2021/05/28/my-blog-post-title.md`
|
||||
- `2021/05-28-my-blog-post-title.md`
|
||||
- `2021/05/28/my-blog-post-title/index.md`
|
||||
- ...
|
||||
| Pattern | Example |
|
||||
| --- | --- |
|
||||
| Single file | `2021-05-28-my-blog-post-title.md` |
|
||||
| MDX file | `2021-05-28-my-blog-post-title.mdx` |
|
||||
| Single folder + `index.md` | `2021-05-28-my-blog-post-title/index.md` |
|
||||
| Folder named by date | `2021-05-28/my-blog-post-title.md` |
|
||||
| Nested folders by date | `2021/05/28/my-blog-post-title.md` |
|
||||
| Partially nested folders by date | `2021/05-28-my-blog-post-title.md` |
|
||||
| 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.
|
||||
|
||||
</details>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue