Refector css and add TOC
This commit is contained in:
@@ -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,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user