make newest post link actually work

This commit is contained in:
2023-03-04 01:39:16 +10:30
parent aadbdeef40
commit 3167af5837
11 changed files with 18 additions and 20 deletions

View File

@ -14,22 +14,16 @@ module.exports = function (eleventyConfig) {
const tagsList = new Set();
collectionApi.getAll().map(item => {
if (item.data.tags) { // handle pages that don't have tags
item.data.tags.map(tag => tagsList.add(tag))
item.data.tags.map(tag => {
if (tag != "post"){
tagsList.add(tag)
}
})
}
});
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) {
if (this.page.outputPath && this.page.outputPath.endsWith(".html")) {
let minified = htmlmin.minify(content, {