Skip to main content

Blog Post Naming Conventions in Docusaurus

· 2 min read
Erik

There are several ways we can name and organize new blog posts with Docusaurus. You can check all the Docusaurus blog post naming patterns on their documentation site. Though let's check some out in this post.

Posts Naming Examples

Shown below are several examples how you could potentially mix and match the naming patterns in Docusaurus 2. Some are more convenient than others.

.
├── blog/
│ ├── 2023/
│ │ ├── 02/
│ │ │ ├── 07/
│ │ │ │ └── trip-to-ny.html
│ │ │ ├── 03-i-ate-pizza.mdx
│ │ │ └── 05-chores-suck.md
│ │ ├── 02-03-some-of-my-favorite-animals/
│ │ │ ├── duck.gif
│ │ │ ├── honey_badger.png
│ │ │ └── index.md
│ │ └── 01-01-happy-new-year.html
│ ├── 2022-12-04-hello-world.md
│ ├── 2022-12-05-feeling-like-a-million-bucks.mdx
│ └── authors.yml
├─...
...

Organizing Assets

When a blog post contains assets such as images, I like to create them as shown in 02-03-some-of-my-favorite-animals/ directory. You can create a folder with the date and post name then drop in all the assets you'll use in that post. For the actual post you'll have to name it index.md, index.html, or index.mdx since the name would get picked up from teh folder name. Then to link or render the assets you can use relative URLs i.e. ![Dancing Duck](./duck.gif).