File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
- # No information - redirects to boolean
1
+ # No information - redirects to boolean
2
+ redirect : /reference/boolean
Original file line number Diff line number Diff line change 1
- # No information - redirects to Element
1
+ # No information - redirects to Element
2
+ redirect : /reference/Element
Original file line number Diff line number Diff line change @@ -5,15 +5,24 @@ import EnhancedMarkdown from '@src/components/EnhancedMarkdown.astro';
5
5
6
6
export async function getStaticPaths() {
7
7
const theTypes = await getCollection (' types' );
8
+
8
9
// Remove types that don't have description
9
- const filteredTypes = theTypes .filter (theType => theType .data && theType .data .description && theType .data .description .trim () !== ' ' );
10
- return filteredTypes .map (theType => ({
11
- params: { theType: theType .id },
12
- props: { theType },
13
- }));
10
+ return theTypes
11
+ .filter ((theType ) => {
12
+ const hasDescription = theType .data ?.description ?.trim ();
13
+ const hasRedirect = theType .data ?.redirect ?.trim ();
14
+ return hasDescription || hasRedirect ;
15
+ })
16
+ .map ((theType ) => ({
17
+ params: { theType: theType .id },
18
+ props: { theType },
19
+ }));
14
20
}
15
21
16
22
const { theType } = Astro .props ;
23
+
24
+ if (theType .data .redirect )
25
+ return Astro .redirect (theType .data .redirect );
17
26
---
18
27
19
28
<StarlightPage frontmatter ={ {
You can’t perform that action at this time.
0 commit comments