mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
fix: legacy redirect embed pages
This commit is contained in:
1 parent
4dd1113b6d
commit
02f0c078a5
6 files changed
+39
-14
No files matched your search
File renamed without changes.
@@ -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" />
|
||||||
Reference in new issue
Block a user