Custom plugin for description and "minutes reading"

This commit is contained in:
DarkCat09 2023-06-18 20:00:53 +04:00
parent 82d3214187
commit 94f3de5337
5 changed files with 236 additions and 8 deletions

View file

@ -1,10 +1,12 @@
import { defineConfig } from 'astro/config';
import compress from "astro-compress";
import remarkPostMeta from './remark-post-meta.mjs';
import remarkUnwrapImages from 'remark-unwrap-images';
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
import rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeFigure from 'rehype-figure';
// https://astro.build/config
export default defineConfig({
@ -14,7 +16,10 @@ export default defineConfig({
},
markdown: {
syntaxHighlight: "shiki",
remarkPlugins: [remarkUnwrapImages],
remarkPlugins: [
remarkPostMeta,
remarkUnwrapImages,
],
rehypePlugins: [
rehypeSlug,
rehypeHeadingIds,
@ -22,6 +27,10 @@ export default defineConfig({
rehypeAutolinkHeadings,
{ behavior: "append" },
],
[
rehypeFigure,
{ className: "rehype-figure" },
],
],
},
});