mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: resurrect tankopedia embeds
This commit is contained in:
1 parent
2dd8ffe570
commit
33cd556c45
1 file changed
+20
-10
@@ -1,5 +1,9 @@
|
|||||||
---
|
---
|
||||||
import { fetchTankDefinitions, TIER_ROMAN_NUMERALS } from '@blitzkit/core';
|
import {
|
||||||
|
asset,
|
||||||
|
fetchTankDefinitions,
|
||||||
|
TIER_ROMAN_NUMERALS,
|
||||||
|
} from '@blitzkit/core';
|
||||||
import strings from '@blitzkit/core/lang/en-US.json';
|
import strings from '@blitzkit/core/lang/en-US.json';
|
||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||||
@@ -17,17 +21,23 @@ const { id } = Astro.params;
|
|||||||
|
|
||||||
const tankDefinitions = await fetchTankDefinitions();
|
const tankDefinitions = await fetchTankDefinitions();
|
||||||
const tank = tankDefinitions.tanks[id];
|
const tank = tankDefinitions.tanks[id];
|
||||||
|
const name = tank.name_full ?? tank.name;
|
||||||
|
const title = `${name} - Tier ${TIER_ROMAN_NUMERALS[tank.tier]} ${
|
||||||
|
strings.common.nations_adjectives[
|
||||||
|
tank.nation as keyof typeof strings.common.nations_adjectives
|
||||||
|
]
|
||||||
|
} ${strings.common.tank_class_short[tank.class]}`;
|
||||||
|
const url = import.meta.env.SITE + Astro.url.pathname;
|
||||||
|
const description = `${name} armor, statistics, equipment, provisions, and more.`;
|
||||||
|
const icon = asset(`icons/tanks/big/${id}.webp`);
|
||||||
---
|
---
|
||||||
|
|
||||||
<title>
|
<title>{title}</title>
|
||||||
{tank.name} - Tier {TIER_ROMAN_NUMERALS[tank.tier]}
|
<meta property="og:title" content={title} />
|
||||||
{
|
<meta name="description" content={description} />
|
||||||
strings.common.nations_adjectives[
|
<meta property="og:description" content={description} />
|
||||||
tank.nation as keyof typeof strings.common.nations_adjectives
|
<meta property="og:image" content={icon} />
|
||||||
]
|
<meta property="og:url" content={url} />
|
||||||
}
|
|
||||||
{strings.common.tank_class_short[tank.class]}
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<BaseLayout>
|
<BaseLayout>
|
||||||
<Page id={id} client:only="react">
|
<Page id={id} client:only="react">
|
||||||
|
|||||||
Reference in new issue
Block a user