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
+31
View File
@@ -1,11 +1,13 @@
import { HtmlBasePlugin } from "@11ty/eleventy";
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
import pluginNavigation from "@11ty/eleventy-navigation";
import { attrs } from "@mdit/plugin-attrs";
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
import markdownitIdAttributes from "markdown-it-anchor";
import path from "node:path";
import { chunk } from "lodash-es";
import pluginFilters from "./_config/filters.js";
@@ -43,6 +45,32 @@ export default async function (eleventyConfig) {
bundleHtmlContentFromSelector: "script",
});
/* Paginate tags */
eleventyConfig.addCollection("doublePagination", function(collection) {
// Get unique list of tags
let tagSet = new Set(collection.getAllSorted().flatMap((post) => post.data.tags || []));
// Get each item that matches the tag
let paginationSize = 20;
let tagMap = [];
let tagArray = [...tagSet];
for( let tagName of tagArray) {
let tagItems = collection.getFilteredByTag(tagName);
let pagedItems = chunk(tagItems.reverse(), paginationSize); // console.log( tagName, tagItems.length, pagedItems.length );
for( let pageNumber = 0, max = pagedItems.length; pageNumber < max; pageNumber++) {
tagMap.push({
tagName: tagName,
pageNumber: pageNumber,
pageSize: pagedItems.length,
pageData: pagedItems[pageNumber]
});
}
}
//console.log( tagMap );
return tagMap;
});
/* Passthroughs */
eleventyConfig
.addPassthroughCopy("favicon.ico")
@@ -76,6 +104,9 @@ export default async function (eleventyConfig) {
},
});
/* Navigation */
eleventyConfig.addPlugin(pluginNavigation);
/* All filters from _config/filters.js */
eleventyConfig.addPlugin(pluginFilters);