Skip to content

Commit

Permalink
Utilize SharedSubessionsLayout for head to head matchup pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinsina committed Sep 18, 2024
1 parent 6ae0f1b commit b5c4d7f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/pages/user/[id]/head-to-head/[otherId].astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
import SharedSubsessionsLayout from "$lib/layouts/shared-subsessions.astro";
import allUserIds from "$lib/utils/user-ids";
import userIdToNameMap from "$lib/utils/user-id-to-name-map";
export async function getStaticPaths() {
return allUserIds
.map((id, index) => {
const allOtherIds = [
...allUserIds.slice(0, index),
...allUserIds.slice(index + 1, allUserIds.length),
];
return allOtherIds.map((otherId) => ({
params: {
id,
otherId,
},
}));
})
.flat();
}
const { id, otherId } = Astro.params;
const userIds = [id, otherId];
const title = `Head To Head Matchup: ${userIdToNameMap.get(id)} versus ${userIdToNameMap.get(otherId)}`;
const description = `Subession result comparison between ${userIdToNameMap.get(id)} and ${userIdToNameMap.get(otherId)}`;
---

<SharedSubsessionsLayout {title} {description} {userIds} />

0 comments on commit b5c4d7f

Please sign in to comment.