build: 🔧 tweak markdown transformation

This commit is contained in:
Sebin Nyshkim 2025-07-04 17:22:15 +02:00
parent a38d38a749
commit 5bccb9f60e

View file

@ -3,7 +3,9 @@ import eleventyPluginNavigation from '@11ty/eleventy-navigation';
import eleventyPluginWebc from '@11ty/eleventy-plugin-webc'; import eleventyPluginWebc from '@11ty/eleventy-plugin-webc';
import Image, { eleventyImagePlugin } from '@11ty/eleventy-img'; import Image, { eleventyImagePlugin } from '@11ty/eleventy-img';
import htmlminifier from 'html-minifier-terser'; import htmlminifier from 'html-minifier-terser';
import markdownIt from 'markdown-it';
const MARKDOWNIT_OPTIONS = { html: true, linkify: true, typographer: true };
const IMAGE_TRANSFORM_OPTS = { const IMAGE_TRANSFORM_OPTS = {
// Set global default options // Set global default options
formats: ['avif', 'webp', 'auto'], formats: ['avif', 'webp', 'auto'],
@ -76,6 +78,8 @@ export default async function (eleventyConfig) {
}); });
eleventyConfig.addPlugin(eleventyPluginNavigation); eleventyConfig.addPlugin(eleventyPluginNavigation);
eleventyConfig.addPlugin(eleventyImagePlugin, IMAGE_TRANSFORM_OPTS); eleventyConfig.addPlugin(eleventyImagePlugin, IMAGE_TRANSFORM_OPTS);
eleventyConfig.setLibrary('md', markdownIt(MARKDOWNIT_OPTIONS));
} }
export const config = { export const config = {