Refector css and add TOC

This commit is contained in:
2026-04-17 21:16:51 -05:00
parent 961d4ba3c3
commit 4f0df71c13
39 changed files with 251 additions and 910 deletions

View File

@@ -12,6 +12,7 @@ import pluginNavigation from "@11ty/eleventy-navigation";
import prettier from "prettier";
import { EleventyHtmlBasePlugin } from "@11ty/eleventy";
import { dateSuffixAdder, monthMap } from "./public/js/modules/dateTools.js";
import tocPlugin from "eleventy-plugin-nesting-toc";
// For PageFind
import childProcess from "child_process";
@@ -127,6 +128,7 @@ export default async function (eleventyConfig) {
eleventyConfig.addPlugin(emojiReadTime, {
label: "minute read time",
});
eleventyConfig.addPlugin(tocPlugin);
// Filters
eleventyConfig.addFilter("niceDate", (date) => {
@@ -146,14 +148,21 @@ export default async function (eleventyConfig) {
return arr.slice(0, arr.length - 1);
});
// Add abbreviation
eleventyConfig.addFilter("abbr", (abbr, def) => {
return `<abbr title="${def}">${abbr}</abbr>`;
});
// Parse as markdown
eleventyConfig.addFilter("markdownify", (markdownString) => {
return mdLib.renderInline(markdownString);
});
// Remove trailing "#" from links
eleventyConfig.addFilter("removeHash", (str) => {
return str.replace(/#<\/a>/g, "</a>");
});
// Shortcodes
// Audio player
eleventyConfig.addShortcode(
@@ -211,12 +220,24 @@ export default async function (eleventyConfig) {
(tag) =>
[
"all",
"nav",
"post",
"posts",
"blogroll",
"feed",
"gallery",
"quiz",
"galleryImage",
"guestbook",
"metadata",
"nav",
"navigator",
"nowBurning",
"onceBurned",
"post",
"postList",
"posts",
"profilePic",
"status",
"tagList",
"tags",
"quiz",
].indexOf(tag) === -1,
);
});