2024-09-14 12:18:30 -05:00
|
|
|
---
|
2025-09-13 21:54:43 -05:00
|
|
|
import { AstroSeo } from "@astrolib/seo";
|
|
|
|
|
import { assertSecret } from "@blitzkit/core";
|
2025-09-27 15:38:37 -05:00
|
|
|
import locales from "@blitzkit/i18n/locales.json";
|
2026-07-31 20:23:39 -05:00
|
|
|
import { AesonPlug } from "../../../components/AesonPlug";
|
2026-08-18 12:49:14 -05:00
|
|
|
import HelpTranslate from "../../../components/HelpTranslate.astro";
|
2026-08-18 12:23:48 -05:00
|
|
|
import HomeCosmetics from "../../../components/HomeCosmetics.astro";
|
|
|
|
|
import HomeGames from "../../../components/HomeGames.astro";
|
2026-07-31 20:23:39 -05:00
|
|
|
import HomeHero from "../../../components/HomeHero.astro";
|
2026-08-18 12:23:48 -05:00
|
|
|
import HomePlayers from "../../../components/HomePlayers.astro";
|
|
|
|
|
import HomeTanks from "../../../components/HomeTanks.astro";
|
|
|
|
|
import HomeTechnical from "../../../components/HomeTechnical.astro";
|
|
|
|
|
import { PageWrapper } from "../../../components/PageWrapper";
|
2026-07-31 20:23:39 -05:00
|
|
|
import { Plugs } from "../../../components/Plugs";
|
|
|
|
|
import { tools, type Tool } from "../../../constants/tools";
|
2026-08-06 14:21:14 -05:00
|
|
|
import { mixStaticPaths } from "../../../core/blitzkit/mixStaticPaths";
|
2026-07-31 20:23:39 -05:00
|
|
|
import { getStrings } from "../../../core/i18n/getStrings";
|
|
|
|
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
2026-08-06 14:21:14 -05:00
|
|
|
import { getStaticPaths as _getStaticPaths } from "../_index";
|
2025-09-13 21:54:43 -05:00
|
|
|
|
|
|
|
|
const MAX_TOOLS_PER_ROW = 2;
|
2024-11-22 10:50:35 -06:00
|
|
|
|
2026-08-08 20:56:45 -05:00
|
|
|
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
|
2025-10-22 17:52:01 -05:00
|
|
|
const { locale } = Astro.props;
|
|
|
|
|
const strings = getStrings(locale);
|
2025-09-13 21:54:43 -05:00
|
|
|
const rows: Tool[][] = [];
|
|
|
|
|
|
2025-09-13 22:53:29 -05:00
|
|
|
for (const id in tools) {
|
|
|
|
|
const tool = tools[id];
|
|
|
|
|
|
|
|
|
|
if ("disabled" in tool && tool.disabled) continue;
|
2025-09-13 21:54:43 -05:00
|
|
|
|
|
|
|
|
const compatibleRow = rows.find(
|
2025-09-13 22:53:29 -05:00
|
|
|
(row) =>
|
|
|
|
|
row.length < MAX_TOOLS_PER_ROW &&
|
2026-03-31 16:51:07 -05:00
|
|
|
!("significant" in row[0] && row[0].significant),
|
2025-09-13 21:54:43 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (compatibleRow) {
|
|
|
|
|
compatibleRow.push(tool);
|
|
|
|
|
} else {
|
|
|
|
|
rows.push([tool]);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-27 12:38:38 -06:00
|
|
|
|
2026-08-06 14:21:14 -05:00
|
|
|
export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
|
2024-12-27 12:38:38 -06:00
|
|
|
return [
|
2025-09-27 15:38:37 -05:00
|
|
|
...locales.supported
|
|
|
|
|
.filter(({ locale }) => locale !== locales.default)
|
2025-10-22 17:52:01 -05:00
|
|
|
.map(({ locale }) => ({ params: { locale }, props: { locale } })),
|
|
|
|
|
{ params: { locale: undefined }, props: { locale: locales.default } },
|
2024-12-27 12:38:38 -06:00
|
|
|
];
|
2026-08-06 14:21:14 -05:00
|
|
|
});
|
2024-09-14 13:24:24 -05:00
|
|
|
---
|
2024-09-14 12:18:30 -05:00
|
|
|
|
2025-04-03 12:34:02 -05:00
|
|
|
<AstroSeo
|
|
|
|
|
title="BlitzKit"
|
|
|
|
|
description={strings.website.home.seo_description}
|
2025-04-03 12:45:33 -05:00
|
|
|
canonical={Astro.url.href}
|
2025-04-03 12:34:02 -05:00
|
|
|
openGraph={{
|
2025-04-03 12:45:33 -05:00
|
|
|
url: Astro.url.href,
|
2025-09-13 21:54:43 -05:00
|
|
|
title: "BlitzKit",
|
2025-04-03 12:45:33 -05:00
|
|
|
description: strings.website.home.seo_description,
|
2025-09-13 21:54:43 -05:00
|
|
|
site_name: "BlitzKit",
|
2025-04-03 12:34:02 -05:00
|
|
|
}}
|
2025-09-13 21:54:43 -05:00
|
|
|
twitter={{ cardType: "summary_large_image" }}
|
2025-04-03 12:34:02 -05:00
|
|
|
/>
|
2025-01-15 13:10:57 -06:00
|
|
|
|
2025-10-22 17:52:01 -05:00
|
|
|
<BaseLayout {locale}>
|
2026-08-18 12:23:48 -05:00
|
|
|
<HomeHero {locale} />
|
2024-09-14 12:18:30 -05:00
|
|
|
|
2026-08-18 12:49:14 -05:00
|
|
|
<HelpTranslate {locale} />
|
2025-01-14 20:19:37 -06:00
|
|
|
|
2024-10-13 00:26:38 -05:00
|
|
|
<Plugs client:idle />
|
2024-09-14 13:24:24 -05:00
|
|
|
|
2024-11-22 10:50:35 -06:00
|
|
|
{
|
2026-08-08 20:56:45 -05:00
|
|
|
environment === "preview" && (
|
2024-11-22 10:50:35 -06:00
|
|
|
<Flex justify="center" my="8" px="4">
|
|
|
|
|
<AesonPlug />
|
|
|
|
|
</Flex>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-18 12:23:48 -05:00
|
|
|
<PageWrapper>
|
|
|
|
|
<HomeTanks {locale} />
|
|
|
|
|
<HomePlayers {locale} />
|
|
|
|
|
<HomeGames {locale} />
|
|
|
|
|
<HomeCosmetics {locale} />
|
|
|
|
|
<HomeTechnical {locale} />
|
|
|
|
|
</PageWrapper>
|
2024-10-12 22:07:59 -05:00
|
|
|
</BaseLayout>
|