oh no i bit more than i could chew oh fuck oh shit *dies*
This commit is contained in:
parent
790147ea05
commit
19b436ead1
73 changed files with 553 additions and 780 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue