Skip to content

Commit 8e86ee9

Browse files
kcmartinclaude
andauthored
Fix API card links to use slugified version in URLs (#100)
Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent a12fd9f commit 8e86ee9

File tree

1 file changed

+3
-37
lines changed

1 file changed

+3
-37
lines changed

scripts/generate-api-docs.ts

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ async function generateIndexPage(
10131013
schema: APISchema,
10141014
versionId: string,
10151015
): Promise<string> {
1016+
const versionSlug = versionToSlug(versionId);
10161017
return `---
10171018
title: API Reference
10181019
description: REST and WebSocket API for managing Sprites programmatically
@@ -1046,7 +1047,7 @@ Create a token at [sprites.dev/account](https://sprites.dev/account), or generat
10461047
<CardGrid client:load>
10471048
${MANUAL_PAGES.map(
10481049
(page) => ` <LinkCard
1049-
href="/api/${versionId}/${page.category}"
1050+
href="/api/${versionSlug}/${page.category}"
10501051
title="${page.title}"
10511052
description="${page.description}"
10521053
icon="code"
@@ -1056,7 +1057,7 @@ ${MANUAL_PAGES.map(
10561057
${categories
10571058
.map(
10581059
(cat) => ` <LinkCard
1059-
href="/api/${versionId}/${cat}"
1060+
href="/api/${versionSlug}/${cat}"
10601061
title="${getCategoryTitle(cat)}"
10611062
description="${getCategoryDescription(cat)}"
10621063
icon="code"
@@ -1066,41 +1067,6 @@ ${categories
10661067
.join('\n')}
10671068
</CardGrid>
10681069
1069-
## SDK Libraries
1070-
1071-
For a better developer experience, use our official SDKs:
1072-
1073-
<CardGrid client:load>
1074-
<LinkCard
1075-
href="/sdks/javascript"
1076-
title="JavaScript SDK"
1077-
description="TypeScript/JavaScript client"
1078-
icon="code"
1079-
client:load
1080-
/>
1081-
<LinkCard
1082-
href="/sdks/go"
1083-
title="Go SDK"
1084-
description="Native Go client"
1085-
icon="code"
1086-
client:load
1087-
/>
1088-
<LinkCard
1089-
href="/sdks/python"
1090-
title="Python SDK"
1091-
description="Python client library"
1092-
icon="code"
1093-
client:load
1094-
/>
1095-
<LinkCard
1096-
href="/sdks/elixir"
1097-
title="Elixir SDK"
1098-
description="Elixir client library"
1099-
icon="code"
1100-
client:load
1101-
/>
1102-
</CardGrid>
1103-
11041070
## Version
11051071
11061072
API Version: \`${schema.version}\`

0 commit comments

Comments
 (0)