diff --git a/config/collections/index.js b/config/collections/index.js index 5d34d05..cc559a4 100644 --- a/config/collections/index.js +++ b/config/collections/index.js @@ -42,8 +42,16 @@ const getPostsByCategory = (collection) => { return postsByCategory; }; +const getAllCatalogue = (collection) => { + const items = collection.getFilteredByGlob( + path.join(dir.input, "content/catalogue/**/*.md"), + ); + return items.reverse(); +}; + module.exports = { - getAllPosts, + getAllCatalogue, getAllPostCategories, + getAllPosts, getPostsByCategory, }; diff --git a/eleventy.config.js b/eleventy.config.js index 83d2bca..7f716b5 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -2,6 +2,7 @@ const { getAllPosts, getAllPostCategories, getPostsByCategory, + getAllCatalogue, } = require("./config/collections/index.js"); const { dir } = require("./config/constants.js"); const { @@ -25,6 +26,7 @@ module.exports = (eleventyConfig) => { eleventyConfig.addCollection("posts", getAllPosts); eleventyConfig.addCollection("categories", getAllPostCategories); eleventyConfig.addCollection("postsByCategory", getPostsByCategory); + eleventyConfig.addCollection("catalogue", getAllCatalogue); // --------------------- Custom Filters ----------------------- eleventyConfig.addFilter("entries", entries);