oh no i bit more than i could chew oh fuck oh shit *dies*

This commit is contained in:
sundae 2026-04-07 11:43:33 +03:00
commit 19b436ead1
Signed by: sundae
SSH key fingerprint: SHA256:MsJkKuo4PUdjQDpLeaURy81drKkW14exlTHp+8QFu6M
73 changed files with 553 additions and 780 deletions

View file

@ -1,19 +1,53 @@
import markdownIt from "markdown-it";
import markdownItAnchor from "markdown-it-anchor";
import slugify from "slugify";
import { format } from "date-fns";
export default async function (eleventyConfig) {
const markdownItOptions = {
html: true
};
const markdownItAnchorOptions = {
permalink: true, permalinkBefore: true, permalinkSymbol: '#'
};
const markdownLib = markdownIt(markdownItOptions).use(
markdownItAnchor,
markdownItAnchorOptions
);
eleventyConfig.setLibrary("md", markdownLib);
/*
const linkAfterHeader = markdownItAnchor.permalink.linkAfterHeader({
class: "anchor",
symbol: "<span hidden>#</span>",
style: "aria-labelledby",
});
const markdownItAnchorOptions = {
level: [1, 2, 3],
slugify: (str) =>
slugify(str, {
lower: true,
strict: true,
remove: /["]/g,
}),
tabIndex: false,
permalink(slug, opts, state, idx) {
state.tokens.splice(
idx,
0,
Object.assign(new state.Token("div_open", "div", 1), {
// Add class "header-wrapper [h1 or h2 or h3]"
attrs: [["class", `heading-wrapper ${state.tokens[idx].tag}`]],
block: true,
})
);
state.tokens.splice(
idx + 4,
0,
Object.assign(new state.Token("div_close", "div", -1), {
block: true,
})
);
linkAfterHeader(slug, opts, state, idx + 1);
},
};
let markdownLibrary = markdownIt({
html: true,
}).use(markdownItAnchor, markdownItAnchorOptions);
eleventyConfig.setLibrary("md", markdownLibrary);
*/
const assets = "./_src/assets/";
eleventyConfig.addPassthroughCopy(assets);
eleventyConfig.addWatchTarget(assets);