mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02: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,10 +3,15 @@ import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import type { GetStaticPaths } from 'astro';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||
import { getStaticPaths as parentGetStaticPaths } from '../../index.astro';
|
||||
import { AUTH_PROVIDERS, AUTH_PROVIDER_NAMES, Authorize } from './_index';
|
||||
|
||||
export const getStaticPaths = (() => {
|
||||
return AUTH_PROVIDERS.map((provider) => ({ params: { provider } }));
|
||||
const parentPaths = parentGetStaticPaths();
|
||||
|
||||
return AUTH_PROVIDERS.map((provider) =>
|
||||
parentPaths.map((parent) => ({ params: { ...parent.params, provider } })),
|
||||
).flat();
|
||||
}) satisfies GetStaticPaths;
|
||||
|
||||
const { provider } = Astro.params;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import { chartsTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
---
|
||||
|
||||
<ToolLayout tool={chartsTool}>
|
||||
|
||||
@@ -3,6 +3,8 @@ import ToolOpenGraph from '../../../../components/ToolOpenGraph.astro';
|
||||
import { compareTool } from '../../../../constants/tools';
|
||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
---
|
||||
|
||||
<ToolOpenGraph tool={compareTool} />
|
||||
|
||||
@@ -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;
|
||||
---
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import { embedTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
---
|
||||
|
||||
<ToolLayout tool={embedTool}>
|
||||
|
||||
@@ -5,6 +5,8 @@ import { fetchGlossary } from '../../../../core/blitz/fetchGlossary';
|
||||
import ToolLayout from '../../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
|
||||
const glossary = await fetchGlossary();
|
||||
const avatars = Object.entries(glossary)
|
||||
.filter(
|
||||
|
||||
@@ -3,6 +3,8 @@ import ToolOpenGraph from '../../../../components/ToolOpenGraph.astro';
|
||||
import { performanceTool } from '../../../../constants/tools';
|
||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
---
|
||||
|
||||
<ToolOpenGraph tool={performanceTool} />
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import { sessionTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
---
|
||||
|
||||
<ToolLayout tool={sessionTool}>
|
||||
|
||||
@@ -15,14 +15,20 @@ import type { GetStaticPaths } from 'astro';
|
||||
import { tankCharacteristics } from '../../../../../core/blitzkit/tankCharacteristics';
|
||||
import BaseLayout from '../../../../../layouts/BaseLayout.astro';
|
||||
import { genericDefaultEquipmentMatrix } from '../../../../../stores/duel/constants';
|
||||
import { getStaticPaths as parentGetStaticPaths } from '../index.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const tankDefinitions = await fetchTankDefinitions();
|
||||
const parentPaths = parentGetStaticPaths();
|
||||
|
||||
return Object.values(tankDefinitions.tanks).map((tank) => ({
|
||||
params: { id: tank.id },
|
||||
}));
|
||||
return Object.values(tankDefinitions.tanks)
|
||||
.map((tank) =>
|
||||
parentPaths.map((parent) => ({
|
||||
params: { ...parent.params, id: tank.id },
|
||||
})),
|
||||
)
|
||||
.flat();
|
||||
}) satisfies GetStaticPaths;
|
||||
|
||||
const { id } = Astro.params;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import { tankopediaTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
---
|
||||
|
||||
<ToolLayout tool={tankopediaTool}>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import { tierListTool } from '../../../../constants/tools';
|
||||
import ToolLayout from '../../../../layouts/ToolLayout.astro';
|
||||
import { Page } from './_index';
|
||||
|
||||
export { getStaticPaths } from '../../index.astro';
|
||||
---
|
||||
|
||||
<ToolLayout tool={tierListTool}>
|
||||
|
||||
Reference in new issue
Block a user