diff --git a/packages/website/src/components/ToolRedirect.astro b/packages/website/src/components/LegacyRedirect.astro similarity index 100% rename from packages/website/src/components/ToolRedirect.astro rename to packages/website/src/components/LegacyRedirect.astro diff --git a/packages/website/src/pages/[...locale]/tools/compare.astro b/packages/website/src/pages/[...locale]/tools/compare.astro deleted file mode 100644 index 6165a704f..000000000 --- a/packages/website/src/pages/[...locale]/tools/compare.astro +++ /dev/null @@ -1,7 +0,0 @@ ---- -import ToolRedirect from '../../../components/ToolRedirect.astro'; - -export { getStaticPaths } from '../index.astro'; ---- - - diff --git a/packages/website/src/pages/[...locale]/tools/compare/index.astro b/packages/website/src/pages/[...locale]/tools/compare/index.astro new file mode 100644 index 000000000..9a8e20b28 --- /dev/null +++ b/packages/website/src/pages/[...locale]/tools/compare/index.astro @@ -0,0 +1,7 @@ +--- +import LegacyRedirect from '../../../../components/LegacyRedirect.astro'; + +export { getStaticPaths } from '../../index.astro'; +--- + + diff --git a/packages/website/src/pages/[...locale]/tools/embed.astro b/packages/website/src/pages/[...locale]/tools/embed.astro deleted file mode 100644 index 179dd726a..000000000 --- a/packages/website/src/pages/[...locale]/tools/embed.astro +++ /dev/null @@ -1,7 +0,0 @@ ---- -import ToolRedirect from '../../../components/ToolRedirect.astro'; - -export { getStaticPaths } from '../index.astro'; ---- - - diff --git a/packages/website/src/pages/[...locale]/tools/embed/[embed]/index.astro b/packages/website/src/pages/[...locale]/tools/embed/[embed]/index.astro new file mode 100644 index 000000000..ca37ab332 --- /dev/null +++ b/packages/website/src/pages/[...locale]/tools/embed/[embed]/index.astro @@ -0,0 +1,25 @@ +--- +import type { GetStaticPaths } from 'astro'; +import LegacyRedirect from '../../../../../components/LegacyRedirect.astro'; +import { embedConfigurations } from '../../../../../constants/embeds'; +import { getStaticPaths as parentGetStaticPaths } from '../index.astro'; + +export const getStaticPaths = (() => { + const parentPaths = parentGetStaticPaths(); + + return Object.keys(embedConfigurations) + .map((embed) => + parentPaths.map((parent) => ({ + params: { + ...parent.params, + embed: embed as keyof typeof embedConfigurations, + }, + })), + ) + .flat(); +}) satisfies GetStaticPaths; + +const { embed } = Astro.params; +--- + + diff --git a/packages/website/src/pages/[...locale]/tools/embed/index.astro b/packages/website/src/pages/[...locale]/tools/embed/index.astro new file mode 100644 index 000000000..c08d6b9bc --- /dev/null +++ b/packages/website/src/pages/[...locale]/tools/embed/index.astro @@ -0,0 +1,7 @@ +--- +import LegacyRedirect from '../../../../components/LegacyRedirect.astro'; + +export { getStaticPaths } from '../../index.astro'; +--- + +