lewisdale.dev/config/filters/filterBy.js

13 lines
383 B
JavaScript
Raw Normal View History

2024-10-06 11:36:54 +00:00
export default (eleventyConfig) => {
2023-12-30 15:38:09 +00:00
eleventyConfig.addFilter('filterBy', (collection, value) => {
return collection.filter((item) => {
return item.data.tags.includes(value);
})
});
2023-12-30 16:36:45 +00:00
eleventyConfig.addFilter('except', (collection, value) => {
return collection.filter((item) => {
return item !== value;
})
});
2023-12-30 15:38:09 +00:00
}