aboutsummaryrefslogtreecommitdiff
path: root/blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx
diff options
context:
space:
mode:
author安竹洋平 <61961825+yasutakeyohei@users.noreply.github.com>2024-01-27 01:25:18 +0900
committer安竹洋平 <61961825+yasutakeyohei@users.noreply.github.com>2024-01-27 01:25:18 +0900
commita1d81c27bdacbd3922ff4118d59e6d75488d3a44 (patch)
treeba1157512be12986d9b2411a08f1a722ca754661 /blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx
parent05714f08e06ea66b44de9ac72404f9f7859e36e5 (diff)
blogのことも追記
Diffstat (limited to 'blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx')
-rw-r--r--blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx9
1 files changed, 9 insertions, 0 deletions
diff --git a/blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx b/blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx
index 3ef3edd8..61d791e5 100644
--- a/blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx
+++ b/blog/2024/01/26/docusaurus-admonition-heading-toc/index.mdx
@@ -200,6 +200,8 @@ TOCは「ASTに含まれているheading要素を単純に配列に入れてい
これでDocusaurusデフォルトプラグイン適用の前後にそれぞれ自作のRemark/Rehypeプラグインが実行されることになります。
+blogなどを入れている場合は、そのプロパティにも記載します。
+
```js title="docusaurus.config.json"
// highlight-start
import admonitionTitleToHeadingBeforeTOC from './src/remark/admonition-title-to-heading-before-toc.js';
@@ -220,6 +222,13 @@ export default {
rehypePlugins: [admonitionTitleToHeadingAfterTOC],
// highlight-end
},
+ blog: {
+ // ...
+ // highlight-start
+ beforeDefaultRemarkPlugins: [admonitionTitleToHeadingBeforeTOC],
+ rehypePlugins: [admonitionTitleToHeadingAfterTOC],
+ // highlight-end
+ },
// ...
}),
]],