fix: legacy redirect embed pages

This commit is contained in:
tresabhi committed 2025-05-16 00:07:43 -05:00
1 parent 4dd1113b6d
commit 02f0c078a5
6 files changed
+39 -14

No files matched your search

@@ -1,7 +0,0 @@
---
import ToolRedirect from '../../../components/ToolRedirect.astro';
export { getStaticPaths } from '../index.astro';
---
<ToolRedirect tool="compare" />
@@ -0,0 +1,7 @@
---
import LegacyRedirect from '../../../../components/LegacyRedirect.astro';
export { getStaticPaths } from '../../index.astro';
---
<LegacyRedirect tool="compare" />
@@ -1,7 +0,0 @@
---
import ToolRedirect from '../../../components/ToolRedirect.astro';
export { getStaticPaths } from '../index.astro';
---
<ToolRedirect tool="embed" />
@@ -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;
---
<LegacyRedirect tool={`embed/${embed}`} />
@@ -0,0 +1,7 @@
---
import LegacyRedirect from '../../../../components/LegacyRedirect.astro';
export { getStaticPaths } from '../../index.astro';
---
<LegacyRedirect tool="embed" />