lewisdale.dev/config/filters/filterBy.js
Lewis Dale e0c315d837
Some checks failed
Build and copy to prod / build-and-copy (push) Has been cancelled
Upgrade to Eleventy 3.0.0
2024-10-06 12:36:54 +01:00

13 lines
383 B
JavaScript

export default (eleventyConfig) => {
eleventyConfig.addFilter('filterBy', (collection, value) => {
return collection.filter((item) => {
return item.data.tags.includes(value);
})
});
eleventyConfig.addFilter('except', (collection, value) => {
return collection.filter((item) => {
return item !== value;
})
});
}