diff options
author | ache <ache@ache.one> | 2022-11-03 01:50:53 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2022-11-03 01:50:53 +0100 |
commit | 1127fb4cd5698436cbfcd4606c0e5216dd0cbaf0 (patch) | |
tree | 62ad7222e2506ed64f6057ff04693dae1f11d261 /src/build/to-html.mjs | |
parent | Use next gen format (diff) |
Add picture support
Diffstat (limited to 'src/build/to-html.mjs')
-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) |