diff --git a/.eleventy.js b/.eleventy.js index 00d8094..b392692 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -12,15 +12,11 @@ const markdownClassMapping = { h5: ['text-lg', 'mt-2', 'text-text'], h6: ['font-bold', 'mt-2', 'text-text'], blockquote: ['border-l-2', 'border-lavender', 'px-4', 'pt-4', 'pb-px', 'my-8', 'bg-base'], - a: [ - 'text-blue', 'underline', - 'visited:text-lavender', - 'hover:no-underline', 'hover:text-sky', 'hover:outline', 'hover:outline-width-1', 'hover:outline-sky', - 'active:no-underline', 'active:text-sky', 'active:outline', 'active:outline-width-1', 'active:outline-sky', - 'focus:no-underline', 'focus:text-sky', 'focus:outline', 'focus:outline-width-1', 'focus:outline-sky' - ], + a: ['link'], s: ['text-red'], p: ['mb-4', 'text-text', 'leading-7'], + strong: ['font-normal', 'text-yellow'], + em: ['italic', 'text-green'], img: ['max-w-full', 'rounded-lg', 'max-h-600px'], ul: ['list-disc', 'ml-4'], }; @@ -46,5 +42,11 @@ module.exports = function(eleventyConfig) { collection => collection.getAllSorted().filter(item => item.data.pinned), ); + eleventyConfig.addFilter('markdown', (value) => { + const md = markdownIt({ linkify: true, html: true }); + md.use(markdownItClass, markdownClassMapping); + return md.render(value); + }); + eleventyConfig.setLibrary('njk', nunjucksEnvironment); }; diff --git a/_includes/base-footer.html b/_includes/base-footer.html index fa56aa1..1553f5e 100644 --- a/_includes/base-footer.html +++ b/_includes/base-footer.html @@ -1,27 +1,27 @@