Created blog collection by filtering based on folder and markdown filetype

This commit is contained in:
Claudia Reynders 2022-04-25 20:47:32 +02:00
parent 6bf2206d03
commit f38b722b09
1 changed files with 7 additions and 0 deletions

View File

@ -5,10 +5,17 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addLayoutAlias('page', 'layouts/page')
/* Creating a collection of blogposts by filtering based on folder and filetype */
eleventyConfig.addCollection("blog", (collectionApi) => {
return collectionApi.getFilteredByGlob('./src/blog/*.md').reverse()
})
return {
dir: {
input: 'src',
output: '_site',
includes: '_includes',
data: '_data'
},
markdownTemplateEngine: 'njk'
}