Skip to content

Commit 4f9d0ca

Browse files
committed
Show a shorter TOC
1 parent 31945af commit 4f9d0ca

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

src/components/nextra-mdx-wrapper.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export function NextraMdxWrapper({
3636
directories,
3737
} = config.normalizePagesResult
3838

39+
console.log(themeContext.toc)
40+
if (themeContext.toc && typeof themeContext.toc === "object") {
41+
toc = themeContext.toc
42+
}
43+
3944
const tocEl =
4045
activeType === "page" ||
4146
!themeContext.toc ||

src/pages/faq/_meta.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
export default {
22
index: {
33
title: "FAQ",
4+
type: "hidden",
45
theme: {
5-
toc: false,
66
sidebar: false,
7+
timestamp: false,
8+
breadcrumb: false,
9+
toc: [
10+
{ value: "Getting Started", id: "getting-started", depth: 2 },
11+
{ value: "General", id: "general", depth: 2 },
12+
{ value: "Best Practices", id: "best-practices", depth: 2 },
13+
{ value: "Specification", id: "specification", depth: 2 },
14+
{ value: "Frontend", id: "frontend", depth: 2 },
15+
{ value: "Foundation", id: "foundation", depth: 2 },
16+
],
717
},
818
},
9-
"getting-started": { display: "hidden" },
10-
general: { display: "hidden" },
11-
"best-practices": { display: "hidden" },
12-
specification: { display: "hidden" },
13-
frontend: { display: "hidden" },
14-
foundation: { display: "hidden" },
19+
"getting-started": "",
20+
general: "",
21+
"best-practices": "",
22+
specification: "",
23+
frontend: "",
24+
foundation: "",
1525
}

src/pages/faq/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Specification from "./specification.mdx"
77
import Frontend from "./frontend.mdx"
88
import Foundation from "./foundation.mdx"
99

10-
<h1 className="typography-h1">Frequently Asked Questions</h1>
10+
<h1 className="typography-h1 hidden">Frequently Asked Questions</h1>
1111

1212
<FaqAggregator>
1313
<GettingStarted components={faqMdxComponents} />

0 commit comments

Comments
 (0)