Description
Is your feature request related to a problem? Please describe.
Currently tags
works as reserved field in the frontmatter that assigns the page to the collections matching a tag name. For values tags: [ hello, World ]
it will populate following collections:
{% for collection in collections | keys %}
- {{ collection }}
{% endfor %}
- all
- hello
- World
It does not hurt much with different approaches to taxonomy but pollutes collections dictionary. For instance, I have a blog with a few hundred posts and about a hundred tags. I chose to approach that instead of polluting collections dictionary nests taxonomies in the following way:
- [taxonomy-name]
- [taxonomy-value]
- pages
i.e.
- all
- tags
- hello
- World
- categories
- blog
- project
- calendar
- 2020
- 2019
If we keep existing behaviour mixing both approaches results in messy collection like:
- all
- tags
- hello
- World
- ...100 other tags
- categories
- blog
- project
... many other categories
- calendar
- 2020
- 2019
... more dates
- hello
- World
- ...100 other tags
Describe the solution you'd like
I'd like to provide to the config toggle that prevents eleventy from populating collections based on tags
field.
Adding such function would allow also to provide predefined taxonomy strategies as npx runnable zero-config libraries (in the same way we do npx @11ty/eleventy
Describe alternatives you've considered
I considered keeping the existing state. Anyhow, I find it limited and too opinionated for generic use of a library like eleventy.
Additional context
- plugin I develop to manage taxonomies in extensible way https://github.com/sielay/eleventy-plugin-blog
- not fully ready yet blog that will use features of that plugin in full of its power https://github.com/sielay/sielay.com/blob/master/.eleventy.js
- I will work on PR for the problem.