Reverse selection - get all tags except one or two?
euro opened this issue · comments
Greg commented
Describe the solution you'd like
I see you have baked in the ability to create a custom collection of a tag (or tags) using the following:
// Get only content that matches a tag
eleventyConfig.addCollection("myTravelPostsWithPhotos", function(collectionApi) {
return collectionApi.getFilteredByTags("post", "travel", "photo");
});
Is there a way to do a negative match? Something like:
eleventyConfig.addCollection("newCollection" = collection.whatever but filter out (!'unwanted')
or even easier:
{% for post in collections.all | except('unwanted', 'another one') %}