Organize columns by subject tags; add /subjects/ page
All checks were successful
Deploy to S3 / deploy (push) Successful in 49s

- Drive the columns collection from the `column` tag, recovering 3 columns
  authored under Notes/ that the glob missed
- Tag the 6 columns with subject tags; add a subjects collection and a
  /subjects/ listing page (newest-first), linked from the footer
This commit is contained in:
2026-06-29 03:05:41 +00:00
parent afb33e26a6
commit c33e4ce861
11 changed files with 74 additions and 7 deletions

View File

@@ -69,12 +69,27 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addShortcode("image", imageShortcode);
eleventyConfig.addShortcode("heroImage", heroImageShortcode);
// A "column" is anything tagged `column`, wherever it lives on disk
// (some columns are authored under Notes/). Newest first.
eleventyConfig.addCollection("columns", function (collectionApi) {
return collectionApi
.getFilteredByGlob("columns/**/*.md")
.getFilteredByTag("column")
.sort((a, b) => b.date - a.date);
});
// The subject tags actually in use across columns — everything except the
// `column` type marker and Eleventy's reserved `all`. Sorted for stable order.
eleventyConfig.addCollection("subjects", function (collectionApi) {
const reserved = new Set(["all", "column"]);
const subjects = new Set();
for (const item of collectionApi.getFilteredByTag("column")) {
for (const tag of item.data.tags || []) {
if (!reserved.has(tag)) subjects.add(tag);
}
}
return [...subjects].sort();
});
eleventyConfig.addFilter("inlineMarkdown", function (text) {
return text.replace(/~~(.+?)~~/g, "<del>$1</del>");
});