Skip to content

Commit 2ab0e75

Browse files
committed
Basic case insensitive route matching for reference
1 parent a41dc9c commit 2ab0e75

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/pages/reference/[...id].astro

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
import type { GetStaticPathsResult } from "astro";
23
import ReferenceItemLayout from "@/src/layouts/ReferenceItemLayout.astro";
34
import {
45
getCollectionInDefaultLocale,
@@ -21,7 +22,16 @@ export async function getStaticPaths() {
2122
return relatedEntry.data.submodule === entry.data.submodule;
2223
}),
2324
},
24-
}));
25+
}))
26+
.reduce<GetStaticPathsResult>((acc, entry) => {
27+
acc.push(entry);
28+
acc.push(Object.assign({}, entry, {
29+
params: {
30+
id: entry.params.id.toLowerCase()
31+
}
32+
}));
33+
return acc;
34+
}, []);
2535
}
2636
2737
const { entry, relatedEntries } = Astro.props;

0 commit comments

Comments
 (0)