updated article series
All checks were successful
Build and Deploy Website / Build Website (push) Successful in 53s
Build and Deploy Website / Deploy Website (push) Has been skipped
Build and Deploy Website / Deploy Dev Website (push) Successful in 9s

This commit is contained in:
Samuel Philipp 2024-04-01 13:47:10 +02:00
parent e658906991
commit 7331e63d4e
4 changed files with 15 additions and 3 deletions

View file

@ -62,6 +62,18 @@ module.exports = function (eleventyConfig) {
.length;
});
eleventyConfig.addCollection("series", function (collectionApi) {
return collectionApi.getAll()
.filter(p => p.data?.series)
.sort((p0, p1) => p0.data.order - p1.data.order)
.reduce((series, post) => {
series[post.data.series] = series[post.data.series] ?? [];
series[post.data.series].push(post);
console.log(series);
return series;
}, {});
});
return {
// Pre-process *.md files with: (default: `liquid`)
markdownTemplateEngine: "njk",