Skip to content

Commit ca6304f

Browse files
committed
Refactor generateStaticParams to skip empty slugs and clarify index handling
1 parent b28dbd3 commit ca6304f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • app/docs/[plugin]/[version]/[...slug]

app/docs/[plugin]/[version]/[...slug]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ export async function generateStaticParams() {
120120
for (const version of repository.versions) {
121121
const versionSlug = version.version;
122122

123-
params.push({ plugin: repoSlug, version: versionSlug, slug: [] });
123+
// Skip empty slug - that's handled by [version]/page.tsx
124+
// params.push({ plugin: repoSlug, version: versionSlug, slug: [] });
124125

125126
// Add limited files for this version
126127
if (version.limited_files) {
127128
for (const file of version.limited_files) {
128129
if (file.slug === 'index') {
129-
continue; // skip index as it's already added
130+
continue; // skip index as it's handled by [version]/page.tsx
130131
}
131132
params.push({ plugin: repoSlug, version: versionSlug, slug: [file.slug] });
132133
}

0 commit comments

Comments
 (0)