big ol copy

This commit is contained in:
2026-09-23 16:25:59 -07:00
parent 210ad9a5fd
commit af82782ee0
36 changed files with 1209 additions and 30 deletions
+13 -1
View File
@@ -1,6 +1,18 @@
import { DateTime } from "luxon";
export default function (eleventyConfig) {
/* Filter out a given url from the collection */
eleventyConfig.addFilter("excludeFromCollection", function (collection=[], pageUrl=this.ctx.page.url) {
return collection.filter(post => post.url !== pageUrl);
});
/* Return only the collection items that match one or more tags */
eleventyConfig.addFilter("filterByTags", function(collection=[], ...requiredTags) {
return collection.filter(post => {
return requiredTags.flat().some(tag => post.data.tags.includes(tag));
});
});
/* Return the keys used in an object */
eleventyConfig.addFilter("getKeys", (target) => {
return Object.keys(target);
@@ -49,7 +61,7 @@ export default function (eleventyConfig) {
/* Filter out structural tags */
eleventyConfig.addFilter("removeBasicTags", (tags) => {
return tags.filter((tag) => ["all"].indexOf(tag) === -1);
return tags.filter((tag) => ["all", "doublePagination"].indexOf(tag) === -1);
});
/* What it says on the tin */