I have a urls like this:
https://mfaani.com/posts/foo/bar
https://mfaani.com/posts/foo/baz
https://mfaani.com/posts/foo/qud
I want users to be able to see all my "foo" blog posts at the following URL:
https://mfaani.com/posts/foo or perhaps https://mfaani.com/foo
But that returns a 404.
Is there a way to achieve this?
It's actually very simple.
Under the https://mfaani.com/posts/foo/
just add an empty _index.md
file.
That will then add all your posts for that category.
It's good idea to add frontmatter to the _index.md
page. Because if you've nested one directory in another, then it will use the _index.md
of the subdirectory to know how to include the description of the subdirectory the list page.
For example if the _index.md
is empty then you'll see:
Alternatively if you add the following frontmatter, then you'll see something like the following:
---
Title: '⚡️ SERIES - Optimizing App Size'
---
A description of the post goes here.