mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: 404 page
This commit is contained in:
1 parent
5adf90bab2
commit
bc6bb4f10e
28 files changed
+1505
-97
No files matched your search
@@ -0,0 +1,30 @@
|
||||
---
|
||||
import locales from '@blitzkit/i18n/locales.json';
|
||||
import { DiscordLogoIcon, HomeIcon } from '@radix-ui/react-icons';
|
||||
import { Button, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
||||
import { LinkI18n } from '../components/LinkI18n';
|
||||
import { PageWrapper } from '../components/PageWrapper';
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
|
||||
const locale = locales.default;
|
||||
---
|
||||
|
||||
<BaseLayout {locale}>
|
||||
<PageWrapper align="center" justify="center" gap="0">
|
||||
<Heading>404: page not found</Heading>
|
||||
<Text color="gray">Where would you like to go?</Text>
|
||||
|
||||
<Flex mt="4" gap="2">
|
||||
<LinkI18n {locale} href="/">
|
||||
<Button>
|
||||
<HomeIcon /> Home
|
||||
</Button>
|
||||
</LinkI18n>
|
||||
<Link href="https://discord.gg/nDt7AjGJQH">
|
||||
<Button variant="outline">
|
||||
<DiscordLogoIcon /> Discord
|
||||
</Button>
|
||||
</Link>
|
||||
</Flex>
|
||||
</PageWrapper>
|
||||
</BaseLayout>
|
||||
@@ -0,0 +1,14 @@
|
||||
import locales from '@blitzkit/i18n/locales.json' with { type: 'json' };
|
||||
import type { APIRoute, GetStaticPaths, GetStaticPathsItem } from 'astro';
|
||||
import { getStrings } from 'packages/website-ue/src/core/i18n/getStrings';
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = () => {
|
||||
return locales.supported.map(
|
||||
({ locale }) => ({ params: { locale } }) satisfies GetStaticPathsItem,
|
||||
);
|
||||
};
|
||||
|
||||
export const GET: APIRoute = async ({ params, request }) => {
|
||||
const strings = await getStrings(params.locale!);
|
||||
return Response.json(strings);
|
||||
};
|
||||
Reference in new issue
Block a user