build: 🔧 tweak markdown transformation
This commit is contained in:
parent
a38d38a749
commit
5bccb9f60e
1 changed files with 4 additions and 0 deletions
|
@ -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 = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue