aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docusaurus.config.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/docusaurus.config.js b/docusaurus.config.js
index c339ace5..bbd3e0e5 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -8,6 +8,14 @@ import {themes as prismThemes} from 'prism-react-renderer';
import admonitionTitleToHeadingBeforeTOC from './src/remark/admonition-title-to-heading-before-toc.js';
import admonitionTitleToHeadingAfterTOC from './src/rehype/admonition-title-to-heading-after-toc.js';
+// sidebarItemsGenerator用
+function skipIndex(items) {
+ return items.filter(({ type, id }) => {
+ return type !== 'doc' || id !== 'ippan-situmon/index';
+ });
+}
+
+
/** @type {import('@docusaurus/types').Config} */
const config = {
title: '東京都小平市議・安竹洋平のまとめ',
@@ -66,6 +74,16 @@ const config = {
beforeDefaultRemarkPlugins: [admonitionTitleToHeadingBeforeTOC],
rehypePlugins: [admonitionTitleToHeadingAfterTOC],
showLastUpdateTime: true,
+ /*
+ autogeneratedとすると、indexも含まれてしまう。docusaurus以降のバージョンでは省けるようになるかもしれないが、
+ https://github.com/facebook/docusaurus/issues/6127
+ 今のところは回避策としてsidebarItemsGeneratorを使ってdocディレクトリ下のindexをページで省くようにする
+ https://stackoverflow.com/a/75046777
+ */
+ async sidebarItemsGenerator({ defaultSidebarItemsGenerator, ...args }) {
+ const sidebarItems = await defaultSidebarItemsGenerator(args);
+ return skipIndex(sidebarItems);
+ }
},
blog: {
blogTitle: 'ふらっとブログ',