mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix imports
This commit is contained in:
1 parent
734db0957e
commit
d1b8bfe244
34 files changed
+99
-139
No files matched your search
+7
-9
@@ -1,18 +1,16 @@
|
||||
---
|
||||
import { Flex, Heading, Text } from "@radix-ui/themes";
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { PageWrapper } from "../../../../../components/PageWrapper";
|
||||
import { mixStaticPaths } from "../../../../../core/blitzkit/mixStaticPaths";
|
||||
import BaseLayout from "../../../../../layouts/BaseLayout.astro";
|
||||
import { getStaticPaths as parentGetStaticPaths } from "../../index.astro";
|
||||
import { getStaticPaths as _getStaticPaths } from "../../index.astro";
|
||||
import { AUTH_PROVIDER_NAMES, AUTH_PROVIDERS, Authorize } from "./_index";
|
||||
|
||||
export const getStaticPaths = (() => {
|
||||
const parentPaths = parentGetStaticPaths();
|
||||
|
||||
return AUTH_PROVIDERS.map((provider) =>
|
||||
parentPaths.map((parent) => ({ params: { ...parent.params, provider } })),
|
||||
).flat();
|
||||
}) satisfies GetStaticPaths;
|
||||
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
return AUTH_PROVIDERS.map((provider) => ({
|
||||
params: { provider },
|
||||
}));
|
||||
});
|
||||
|
||||
const { provider } = Astro.params;
|
||||
const { locale } = Astro.props;
|
||||
|
||||
+17
-24
@@ -1,39 +1,32 @@
|
||||
---
|
||||
import { AstroSeo } from "@astrolib/seo";
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { readFile } from "fs/promises";
|
||||
import { mixStaticPaths } from "../../../../../../core/blitzkit/mixStaticPaths";
|
||||
import BaseLayout from "../../../../../../layouts/BaseLayout.astro";
|
||||
import { getStaticPaths as parentGetStaticPaths } from "../../../index.astro";
|
||||
import { getStaticPaths as _getStaticPaths } from "../../../index.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const parentPaths = parentGetStaticPaths();
|
||||
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
const ROOT = "../../../../../../../../../docs/";
|
||||
const files = import.meta.glob("../../../../../../../../../docs/**/*.md", {
|
||||
eager: true,
|
||||
});
|
||||
|
||||
return (
|
||||
await Promise.all(
|
||||
Object.keys(files).map(async (file) => {
|
||||
const couple = file.replace(ROOT, "").split("/");
|
||||
couple[1] = couple[1].replace(".md", "");
|
||||
const content = await readFile(
|
||||
`../../docs/${couple[0]}/${couple[1]}.md`,
|
||||
).then((buffer) => buffer.toString());
|
||||
return await Promise.all(
|
||||
Object.keys(files).map(async (file) => {
|
||||
const couple = file.replace(ROOT, "").split("/");
|
||||
couple[1] = couple[1].replace(".md", "");
|
||||
const content = await readFile(
|
||||
`../../docs/${couple[0]}/${couple[1]}.md`,
|
||||
).then((buffer) => buffer.toString());
|
||||
|
||||
return parentPaths.map((parent) => ({
|
||||
params: {
|
||||
...parent.params,
|
||||
directory: couple[0],
|
||||
document: couple[1],
|
||||
},
|
||||
props: { ...parent.props, content },
|
||||
}));
|
||||
}),
|
||||
)
|
||||
).flat();
|
||||
}) satisfies GetStaticPaths;
|
||||
return {
|
||||
params: { directory: couple[0], document: couple[1] },
|
||||
props: { content },
|
||||
};
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
const { content, locale } = Astro.props;
|
||||
|
||||
|
||||
+7
-16
@@ -1,26 +1,17 @@
|
||||
---
|
||||
import { AstroSeo } from "@astrolib/seo";
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { capitalize } from "lodash-es";
|
||||
import { embedConfigurations } from "../../../../../constants/embeds";
|
||||
import { mixStaticPaths } from "../../../../../core/blitzkit/mixStaticPaths";
|
||||
import BaseLayout from "../../../../../layouts/BaseLayout.astro";
|
||||
import { getStaticPaths as parentGetStaticPaths } from "../index.astro";
|
||||
import { getStaticPaths as _getStaticPaths } from "../index.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
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;
|
||||
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
return Object.keys(embedConfigurations).map((embed) => ({
|
||||
params: { embed: embed as keyof typeof embedConfigurations },
|
||||
}));
|
||||
});
|
||||
|
||||
const name = capitalize(Astro.params.embed);
|
||||
const title = `BlitzKit - ${name} embed`;
|
||||
|
||||
@@ -8,30 +8,25 @@ import {
|
||||
} from "@blitzkit/core";
|
||||
import { unwrapper } from "@blitzkit/i18n";
|
||||
import { literals } from "@blitzkit/i18n/src/literals";
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { load } from "cheerio";
|
||||
import { api } from "../../../../../core/blitzkit/api";
|
||||
import { mixStaticPaths } from "../../../../../core/blitzkit/mixStaticPaths";
|
||||
import { tankCharacteristics } from "../../../../../core/blitzkit/tankCharacteristics";
|
||||
import { getStrings } from "../../../../../core/i18n/getStrings";
|
||||
import BaseLayout from "../../../../../layouts/BaseLayout.astro";
|
||||
import { genericDefaultEquipmentMatrix } from "../../../../../stores/duel/constants";
|
||||
import type { TankGuide } from "../../../../../types/tankGuide";
|
||||
import { getStaticPaths as parentGetStaticPaths } from "../index.astro";
|
||||
import { getStaticPaths as _getStaticPaths } from "../index.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
const tankDefinitions = await api.tankDefinitions();
|
||||
const parentPaths = parentGetStaticPaths();
|
||||
|
||||
return Object.values(tankDefinitions.tanks)
|
||||
.map((tank) =>
|
||||
parentPaths.map((parent) => ({
|
||||
params: { ...parent.params, slug: tank.slug },
|
||||
props: { ...parent.props, id: tank.id },
|
||||
})),
|
||||
)
|
||||
.flat();
|
||||
}) satisfies GetStaticPaths;
|
||||
return Object.values(tankDefinitions.tanks).map((tank) => ({
|
||||
params: { slug: tank.slug },
|
||||
props: { id: tank.id },
|
||||
}));
|
||||
});
|
||||
|
||||
const { id, locale } = Astro.props;
|
||||
const strings = getStrings(locale);
|
||||
|
||||
+7
-16
@@ -1,23 +1,14 @@
|
||||
---
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { embedConfigurations } from "../../../../../../constants/embeds";
|
||||
import { mixStaticPaths } from "../../../../../../core/blitzkit/mixStaticPaths";
|
||||
import LegacyRedirect from "../../../../../../layouts/LegacyRedirect.astro";
|
||||
import { getStaticPaths as parentGetStaticPaths } from "../index.astro";
|
||||
import { getStaticPaths as _getStaticPaths } 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;
|
||||
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
return Object.keys(embedConfigurations).map((embed) => ({
|
||||
params: { embed },
|
||||
}));
|
||||
});
|
||||
|
||||
const { embed } = Astro.params;
|
||||
const { locale } = Astro.props;
|
||||
|
||||
+7
-15
@@ -1,22 +1,14 @@
|
||||
---
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { api } from "../../../../../../core/blitzkit/api";
|
||||
import { mixStaticPaths } from "../../../../../../core/blitzkit/mixStaticPaths";
|
||||
import LegacyRedirect from "../../../../../../layouts/LegacyRedirect.astro";
|
||||
import { getStaticPaths as parentGetStaticPaths } from "../index.astro";
|
||||
import { getStaticPaths as _getStaticPaths } from "../index.astro";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const tankDefinitions = await api.tankDefinitions();
|
||||
const parentPaths = parentGetStaticPaths();
|
||||
|
||||
return Object.values(tankDefinitions.tanks)
|
||||
.map((tank) =>
|
||||
parentPaths.map((parent) => ({
|
||||
params: { ...parent.params, id: tank.id },
|
||||
props: parent.props,
|
||||
})),
|
||||
)
|
||||
.flat();
|
||||
}) satisfies GetStaticPaths;
|
||||
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
return Object.values(tankDefinitions.tanks).map(({ id }) => ({
|
||||
params: { id },
|
||||
}));
|
||||
});
|
||||
|
||||
const { id } = Astro.params;
|
||||
const { locale } = Astro.props;
|
||||
|
||||
Reference in new issue
Block a user