From c3d9aee7e335e2b84a080260d2792be5d0189cd0 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Wed, 20 Dec 2023 01:33:56 +0200 Subject: [PATCH] fix slug creations --- packages/releases-generator/build.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/releases-generator/build.ts b/packages/releases-generator/build.ts index 5bbe0a83af..3a8006bbe8 100644 --- a/packages/releases-generator/build.ts +++ b/packages/releases-generator/build.ts @@ -32,11 +32,6 @@ const packages = [ }, ]; -// FIXME: starlight apparently doesn't work well if the file continas multiple `.` -function encodeVersion(v: string): string { - return v.replaceAll('.', '_'); -} - const baseDir = '../../src/content/docs/releases'; async function generator() { @@ -59,15 +54,15 @@ async function generator() { mkdirSync(join(baseDir, pkg.name), { recursive: true }); writeFileSync( join(baseDir, pkg.name, 'index.md'), - `---\ntitle: '${pkg.name}'\nslug: '${pkg.name}'\ntemplate: splash\n---\n\n${releases - .map((r) => `- [${r.version}](/releases/${pkg.name}/v${encodeVersion(r.version)})`) + `---\ntitle: '${pkg.name}'\nslug: 'releases/${pkg.name}'\ntemplate: splash\n---\n\n${releases + .map((r) => `- [${r.version}](/releases/${pkg.name}/v${r.version})`) .join('\n')}` ); for (const release of releases) { writeFileSync( join(baseDir, pkg.name, `v${release.version}.md`), - `---\ntitle: '${pkg.name}@${release.version}'\nslug: 'v${release.version}'\ntemplate: splash\n---\n\n${release.notes}` + `---\ntitle: '${pkg.name}@${release.version}'\nslug: 'releases/${pkg.name}/v${release.version}'\ntemplate: splash\n---\n\n${release.notes}` ); } }