add a sorted list of files with tags

This commit is contained in:
2023-03-04 00:35:38 +10:30
committed by GitHub
parent 8c2b5c8e37
commit aadbdeef40

View File

@ -20,6 +20,16 @@ module.exports = function (eleventyConfig) {
return tagsList; return tagsList;
}); });
eleventyConfig.addCollection("mostRecent", function (collectionApi) {
const out = new Set();
collectionApi.getAllSorted().map(item => {
if (item.data.tags) {
out.add(item);
}
})
return out;
})
eleventyConfig.addTransform("htmlmin", function (content) { eleventyConfig.addTransform("htmlmin", function (content) {
if (this.page.outputPath && this.page.outputPath.endsWith(".html")) { if (this.page.outputPath && this.page.outputPath.endsWith(".html")) {
let minified = htmlmin.minify(content, { let minified = htmlmin.minify(content, {