Files
blitzkit/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro
T

76 lines
2.2 KiB
Plaintext
Raw Normal View History

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-08-30 15:02:01 -05:00
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
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";
import HomePlayers from "../../../components/HomePlayers.astro";
import HomeTanks from "../../../components/HomeTanks.astro";
import HomeTechnical from "../../../components/HomeTechnical.astro";
2026-07-31 20:23:39 -05:00
import { tools, type Tool } from "../../../constants/tools";
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, () => {
2026-08-30 15:02:01 -05:00
return locales.supported.map(({ locale }) => ({
props: { locale },
params: { locale: locale === locales.default ? undefined : locale },
}));
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
2026-08-18 13:02:59 -05:00
<BaseLayout accent="blue" {locale}>
<!-- <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
2026-08-18 13:02:59 -05:00
{environment === "preview" && <AesonPlug />}
2024-09-14 13:24:24 -05:00
2026-08-18 13:02:59 -05:00
<HomeTanks {locale} />
<HomePlayers {locale} />
<HomeGames {locale} />
<HomeCosmetics {locale} />
<HomeTechnical {locale} />
2024-10-12 22:07:59 -05:00
</BaseLayout>