mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: paths
This commit is contained in:
1 parent
bcde319ac1
commit
ee94d762d0
3 files changed
+35
-25
No files matched your search
@@ -4,6 +4,7 @@ import { DEFAULT_LOCALE } from '@blitzkit/i18n';
|
|||||||
import { Box, Code, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
import { Box, Code, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
||||||
import packageJson from '../../../../package.json';
|
import packageJson from '../../../../package.json';
|
||||||
import { getStrings } from '../core/i18n/getStrings';
|
import { getStrings } from '../core/i18n/getStrings';
|
||||||
|
import { LinkI18n } from './LinkI18n';
|
||||||
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
||||||
|
|
||||||
const gameDefinitions = await fetchGameDefinitions();
|
const gameDefinitions = await fetchGameDefinitions();
|
||||||
@@ -78,9 +79,9 @@ const strings = getStrings(locale);
|
|||||||
sm: 'start',
|
sm: 'start',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link href="/docs/about/credits" color="gray">
|
<LinkI18n {locale} href="/docs/about/credits" color="gray">
|
||||||
{strings.website.footer.about.credits}
|
{strings.website.footer.about.credits}
|
||||||
</Link>
|
</LinkI18n>
|
||||||
<Link
|
<Link
|
||||||
href="https://discord.gg/nDt7AjGJQH"
|
href="https://discord.gg/nDt7AjGJQH"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@@ -95,9 +96,9 @@ const strings = getStrings(locale);
|
|||||||
>
|
>
|
||||||
{strings.website.footer.about.github}
|
{strings.website.footer.about.github}
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/docs/patches" color="gray">
|
<LinkI18n {locale} href="/docs/patches" color="gray">
|
||||||
{strings.website.footer.about.patches}
|
{strings.website.footer.about.patches}
|
||||||
</Link>
|
</LinkI18n>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
@@ -115,12 +116,12 @@ const strings = getStrings(locale);
|
|||||||
>
|
>
|
||||||
<Heading size="3">{strings.website.footer.legal.title}</Heading>
|
<Heading size="3">{strings.website.footer.legal.title}</Heading>
|
||||||
<Flex direction="column">
|
<Flex direction="column">
|
||||||
<Link href="/docs/legal/privacy-policy" color="gray">
|
<LinkI18n {locale} href="/docs/legal/privacy-policy" color="gray">
|
||||||
{strings.website.footer.legal.privacy}
|
{strings.website.footer.legal.privacy}
|
||||||
</Link>
|
</LinkI18n>
|
||||||
<Link href="/docs/legal/terms-of-service" color="gray">
|
<LinkI18n {locale} href="/docs/legal/terms-of-service" color="gray">
|
||||||
{strings.website.footer.legal.terms}
|
{strings.website.footer.legal.terms}
|
||||||
</Link>
|
</LinkI18n>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -2,28 +2,37 @@
|
|||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
import BaseLayout from '../../../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../../../layouts/BaseLayout.astro';
|
||||||
|
import { getStaticPaths as parentGetStaticPaths } from '../../../index.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
const ROOT = '../../../../../../../docs/';
|
const parentPaths = parentGetStaticPaths();
|
||||||
const files = import.meta.glob('../../../../../../../docs/**/*.md', {
|
|
||||||
|
const ROOT = '../../../../../../../../docs/';
|
||||||
|
const files = import.meta.glob('../../../../../../../../docs/**/*.md', {
|
||||||
eager: true,
|
eager: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
return await Promise.all(
|
return (
|
||||||
Object.keys(files).map(async (file) => {
|
await Promise.all(
|
||||||
const couple = file.replace(ROOT, '').split('/');
|
Object.keys(files).map(async (file) => {
|
||||||
couple[1] = couple[1].replace('.md', '');
|
const couple = file.replace(ROOT, '').split('/');
|
||||||
const content = await readFile(
|
couple[1] = couple[1].replace('.md', '');
|
||||||
`../../docs/${couple[0]}/${couple[1]}.md`,
|
const content = await readFile(
|
||||||
).then((buffer) => buffer.toString());
|
`../../docs/${couple[0]}/${couple[1]}.md`,
|
||||||
|
).then((buffer) => buffer.toString());
|
||||||
|
|
||||||
return {
|
return parentPaths.map((parent) => ({
|
||||||
params: { directory: couple[0], document: couple[1] },
|
params: {
|
||||||
props: { content },
|
...parent.params,
|
||||||
};
|
directory: couple[0],
|
||||||
}),
|
document: couple[1],
|
||||||
);
|
},
|
||||||
|
props: { content },
|
||||||
|
}));
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
).flat();
|
||||||
}) satisfies GetStaticPaths;
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
const { content } = Astro.props;
|
const { content } = Astro.props;
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
|||||||
export { getStaticPaths } from '../../index.astro';
|
export { getStaticPaths } from '../../index.astro';
|
||||||
|
|
||||||
// this can't be used in template literal :(
|
// this can't be used in template literal :(
|
||||||
const ROOT = '../../../../../../docs/changelogs/';
|
const ROOT = '../../../../../../../docs/changelogs/';
|
||||||
|
|
||||||
const versions = Object.keys(
|
const versions = Object.keys(
|
||||||
import.meta.glob(`../../../../../../docs/changelogs/*.md`, {
|
import.meta.glob('../../../../../../../docs/changelogs/*.md', {
|
||||||
eager: true,
|
eager: true,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user