diff options
Diffstat (limited to 'src/build')
-rw-r--r-- | src/build/to-html.mjs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/build/to-html.mjs b/src/build/to-html.mjs index 4bc3c06..adfcd7a 100644 --- a/src/build/to-html.mjs +++ b/src/build/to-html.mjs @@ -7,6 +7,7 @@ import remarkMath from 'remark-math'; import remarkFrontmatter from 'remark-frontmatter'; import remarkRehype from 'remark-rehype'; import rehypeSlug from 'rehype-slug'; +import rehypePicture from 'rehype-picture' import rehypeKaTeX from 'rehype-katex'; import rehypeRaw from 'rehype-raw'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; @@ -23,6 +24,10 @@ const autoLinkOption = { }, }; +const pictureOptions = { + 'png': {avif: 'image/avif'} +} + const generator = unified() .use(remarkParse) .use(remarkGfm) @@ -34,6 +39,7 @@ const generator = unified() .use(remarkRehype, {allowDangerousHtml: true}) .use(rehypeRaw) .use(remarkRemoveFootnoteHeader) + .use(rehypePicture, pictureOptions) .use(rehypeKaTeX) .use(rehypeSlug) .use(rehypeHighlight) @@ -53,6 +59,7 @@ const generatorHTML = unified() .use(remarkRehype, {allowDangerousHtml: true}) .use(rehypeRaw) .use(remarkRemoveFootnoteHeader) + .use(rehypePicture, pictureOptions) .use(rehypeKaTeX) .use(rehypeSlug) .use(rehypeHighlight) |