diff options
Diffstat (limited to 'src/components/landing/Section.tsx')
-rw-r--r-- | src/components/landing/Section.tsx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/landing/Section.tsx b/src/components/landing/Section.tsx index f44272d..caec6b6 100644 --- a/src/components/landing/Section.tsx +++ b/src/components/landing/Section.tsx | |||
@@ -4,21 +4,33 @@ | |||
4 | * SPDX-License-Identifier: MIT | 4 | * SPDX-License-Identifier: MIT |
5 | */ | 5 | */ |
6 | 6 | ||
7 | import useBrokenLinks from '@docusaurus/useBrokenLinks'; | ||
7 | import type { ReactNode } from 'react'; | 8 | import type { ReactNode } from 'react'; |
8 | 9 | ||
9 | import styles from './Section.module.css'; | 10 | import styles from './Section.module.css'; |
10 | 11 | ||
11 | export default function Section({ | 12 | export default function Section({ |
12 | title, | 13 | title, |
14 | id, | ||
13 | children, | 15 | children, |
14 | }: { | 16 | }: { |
15 | title: string; | 17 | title: string; |
18 | id: string; | ||
16 | children?: ReactNode; | 19 | children?: ReactNode; |
17 | }) { | 20 | }) { |
21 | // Make sure the section anchors are not reported as broken. | ||
22 | // See https://docusaurus.io/blog/releases/3.1#broken-anchors-checker and | ||
23 | // https://github.com/facebook/docusaurus/issues/9721#issuecomment-1882898840 | ||
24 | useBrokenLinks().collectAnchor(id); | ||
25 | |||
18 | return ( | 26 | return ( |
19 | <section className={styles.section}> | 27 | <section id={id} className={styles.section}> |
20 | <h2 className={styles.section__title}>{title}</h2> | 28 | <h2 className={styles.section__title}>{title}</h2> |
21 | {children} | 29 | {children} |
22 | </section> | 30 | </section> |
23 | ); | 31 | ); |
24 | } | 32 | } |
33 | |||
34 | Section.defaultProps = { | ||
35 | children: undefined, | ||
36 | }; | ||