Skip to content

Commit 84b3773

Browse files
staredclaude
andcommitted
Fix game URLs - remove .md extension from links
URLs now work correctly: - Homepage links to games without .md extension - Individual game pages accessible at clean URLs - Example: /games/quantum-game-with-photons instead of /games/quantum-game-with-photons.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5368274 commit 84b3773

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

site/src/pages/games/[...id].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Layout from '../../layouts/Layout.astro';
55
export async function getStaticPaths() {
66
const games = await getCollection('games');
77
return games.map(game => ({
8-
params: { id: game.id },
8+
params: { id: game.id.replace('.md', '') },
99
props: { game },
1010
}));
1111
}

site/src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const gamesByCategory = categories.reduce((acc, category) => {
7070
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
7171
{gamesByCategory[category].map(game => (
7272
<a
73-
href={`/games/${game.id}`}
73+
href={`/games/${game.id.replace('.md', '')}`}
7474
class="game-card block p-4 border border-gray-200 rounded hover:border-gray-400 transition-colors space-y-2"
7575
data-title={game.data.title.toLowerCase()}
7676
data-topics={game.data.topics.join(',').toLowerCase()}

0 commit comments

Comments
 (0)