Open zachleat opened 1 year ago
It could also look like having control over what goes into the collection by handling what it’s aggregating. Maybe:
A: Compose an array with template (or output) extensions. Kinda like templateFormats
.
B: Opt in or out of extensions. Kinda like ignores.add
and ignores.delete
.
Both eleventyExcludeFromCollections
and pagination:addAllPagesToCollections
could also use some granular controls.
For example:
pagination:
addAllPagesToCollections: true
tags:
- foobar
- quux
This will add it to all collections
pagination:
addAllPagesToCollections:
- all
- foobar
tags:
- foobar
- quux
That would only add it to the "all" and "foobar" collections, but not to the "quux" collection.
For eleventyExcludeFromCollections
the similar approach could be used. But it becomes a bit more tricky. true
would exclude it from everything [all, foobar]
would exclude it from the "all" and "foobar" collection. But what if you want to exclude it from all collections, except for "quux"? Maybe add a eleventyIncludeInCollections
which defaults to true
and does the exact opposite?
Related #2830 and #2482 both shipping with 3.0
Like
eleventyExcludeFromCollections
but set in https://www.11ty.dev/docs/languages/custom/ somewhere.cc @5t3ph
https://github.com/5t3ph/eleventy-plugin-sass-lightningcss#usage
Just thinking out loud: maybe it’d be nice to have a
collections
entry for HTML-only stuff? Or even more breakingly, shouldcollections.all
include non-HTML files (probably not this, that’s too big of a breaking change)?Related: https://www.11ty.dev/docs/languages/custom/#outputfileextension