Remove custom collection for feed items and fix tag fileter for contents

This commit is contained in:
Helen Chong 2024-04-16 22:07:58 +08:00
parent 6452e55832
commit ed3ff98440
1 changed files with 1 additions and 8 deletions

View File

@ -89,17 +89,10 @@ module.exports = function (eleventyConfig) {
/* This is the part that tells 11ty to swap to our custom config */ /* This is the part that tells 11ty to swap to our custom config */
eleventyConfig.setLibrary("md", markdownLibrary); eleventyConfig.setLibrary("md", markdownLibrary);
// Add contents to a feed items collection
eleventyConfig.addCollection("feedItems", function (collectionApi) {
return collectionApi.getFilteredByTags(
'articles', 'posts', 'changelogs'
);
});
// Add content categories to a collection // Add content categories to a collection
eleventyConfig.addCollection("categories", function(collectionApi) { eleventyConfig.addCollection("categories", function(collectionApi) {
let categories = new Set(); let categories = new Set();
let contents = collectionApi.getFilteredByTags('articles', 'posts'); let contents = collectionApi.getFilteredByTag('contents');
contents.forEach(p => { contents.forEach(p => {
let cats = p.data.categories; let cats = p.data.categories;
cats.forEach(c => categories.add(c)); cats.forEach(c => categories.add(c));