From 8745a2fb40abf79ab7f9969eeef3301ccf4970e3 Mon Sep 17 00:00:00 2001 From: vanntile <33692650+vanntile@users.noreply.github.com> Date: Fri, 14 Apr 2023 11:52:09 +0300 Subject: [PATCH] config(build): :wrench: use rehype-toc after rehype-slug --- astro.config.mjs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 01895a7..ba71be4 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,12 +1,12 @@ import markdoc from '@astrojs/markdoc' import mdx from '@astrojs/mdx' import tailwind from '@astrojs/tailwind' +import rehypeToc from '@jsdevtools/rehype-toc' import { defineConfig } from 'astro/config' import rehypeAutolinkHeadings from 'rehype-autolink-headings' import rehypePrettyCode from 'rehype-pretty-code' import rehypeSlug from 'rehype-slug' import rehypeSortAttributes from 'rehype-sort-attributes' -import rehypeToc from 'rehype-toc' import remarkHint from 'remark-hint' import { getHighlighter } from 'shiki' import { @@ -55,17 +55,6 @@ export default defineConfig({ rehypePlugins: [ [rehypePrettyCode, prettyCodeOptions], [rehypePrettyCodeStyleToClass, { stylesMap: [['font-style: italic', 'italic']] }], - [ - rehypeToc, - { - nav: false, - cssClasses: { - list: '', - listItem: '', - link: '', - }, - }, - ], rehypeSlug, [ rehypeAutolinkHeadings, @@ -78,6 +67,7 @@ export default defineConfig({ }, }, ], + [rehypeToc, { nav: false, cssClasses: { list: '', listItem: '', link: '' } }], rehypeSortAttributes, ], },