I have the following posts in my blog :
src/documents/posts/foo.html.md
---
category: cooking
---
src/documents/posts/bar.html.md
---
category: programmation
---
I would like to generate the following routes :
http://example.org/cooking/
http://example.org/programmation/
Where each route would have a collection with only posts in the selected category. The posts would still be in the standard place :
http://example.org/posts/foo.html
http://example.org/posts/bar.html
Bonus point : I would also like to be able to list categories in my layout. Something like :
<% for cat in @getCategories() %>
<a href="<%= cat.route %>"><%= cat.name %></a>
<% endfor %>
Is there a plugin already existing which give these kind of functionalities ? If not, what's the best way to starting implementing it ?
I have seen the setFilter method in this answer, but I'm still struggling to find out how to generate new pages after parsing every posts to fetch categories.
If dynamic page generation cannot be achieved (which I could understand, since it would require to parse pages in a specific order), would having a static array in the configuration make it easier ?