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';
55
66export async function getStaticPaths() {
77 const theTypes = await getCollection (' types' );
8+
89 // 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+ }));
1420}
1521
1622const { theType } = Astro .props ;
23+
24+ if (theType .data .redirect )
25+ return Astro .redirect (theType .data .redirect );
1726---
1827
1928<StarlightPage frontmatter ={ {
You can’t perform that action at this time.
0 commit comments