mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-26 07:33:48 +01:00
feat: i18n paths
This commit is contained in:
1 parent
68362c22b1
commit
1f577c2317
11 files changed
+44
-7
No files matched your search
@@ -3,12 +3,22 @@ import type { GetStaticPaths } from 'astro';
|
||||
import { capitalize } from 'lodash-es';
|
||||
import { embedConfigurations } from '../../../../../constants/embeds';
|
||||
import BaseLayout from '../../../../../layouts/BaseLayout.astro';
|
||||
import { getStaticPaths as parentGetStaticPaths } from '../index.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export const getStaticPaths = (() => {
|
||||
return Object.keys(embedConfigurations).map((embed) => ({
|
||||
params: { embed: embed as keyof typeof embedConfigurations },
|
||||
}));
|
||||
const parentPaths = parentGetStaticPaths();
|
||||
|
||||
return Object.keys(embedConfigurations)
|
||||
.map((embed) =>
|
||||
parentPaths.map((parent) => ({
|
||||
params: {
|
||||
...parent.params,
|
||||
embed: embed as keyof typeof embedConfigurations,
|
||||
},
|
||||
})),
|
||||
)
|
||||
.flat();
|
||||
}) satisfies GetStaticPaths;
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user