27 lines
760 B
JavaScript
27 lines
760 B
JavaScript
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
|
|
const markdownIt = require('markdown-it');
|
|
const markdownItClass = require('@toycode/markdown-it-class');
|
|
|
|
const markdownClassMapping = {
|
|
h1: ['text-4xl'],
|
|
h2: ['text-3xl'],
|
|
h3: ['text-2xl'],
|
|
h4: ['text-xl'],
|
|
h5: ['text-lg'],
|
|
h6: ['font-bold'],
|
|
a: ['text-blue-300', 'hover:underline'],
|
|
p: ['mb-2'],
|
|
};
|
|
|
|
module.exports = function(eleventyConfig) {
|
|
eleventyConfig.addPlugin(syntaxHighlight);
|
|
|
|
const md = markdownIt({ linkify: true, html: true });
|
|
md.use(markdownItClass, markdownClassMapping);
|
|
eleventyConfig.setLibrary('md', md);
|
|
|
|
eleventyConfig.addCollection(
|
|
"pinned",
|
|
collection => collection.getAllSorted().filter(item => item.data.pinned),
|
|
);
|
|
};
|