diff --git a/.vscode/settings.json b/.vscode/settings.json index 616b9e6b7..669c0629f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,6 +14,7 @@ "applypatches", "artefacts", "astrojs", + "astrolib", "atgm", "Autoloader", "Autoreloader", diff --git a/bun.lockb b/bun.lockb index 2c3aadebe..8f847e677 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 1eae21f53..4af90c3f4 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -844,6 +844,13 @@ "seo_description": "Tools for everything World of Tanks Blitz" }, + "docs": { + "patches": { + "name": "BlitzKit Changelogs", + "seo_description": "Changelogs for BlitzKit Discord bot and website" + } + }, + "tools": { "tankopedia": { "name": "Tankopedia", diff --git a/packages/website/package.json b/packages/website/package.json index 4e88aa0c1..188792c80 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@astrojs/partytown": "^2.1.4", + "@astrolib/seo": "^1.0.0-beta.8", "@blitzkit/core": "workspace:*", "@blitzkit/i18n": "workspace:*", "@nanostores/persistent": "^0.10.2", diff --git a/packages/website/src/components/Navbar.astro b/packages/website/src/components/Navbar.astro index 95a4d56a2..8d0693926 100644 --- a/packages/website/src/components/Navbar.astro +++ b/packages/website/src/components/Navbar.astro @@ -73,161 +73,161 @@ const strings = getStrings(locale); > - - - - BlitzKit + + + + + BlitzKit + { + isBranchNamed && ( + + {branchName} + + ) + } + + + + + + { - isBranchNamed && ( - - {branchName} - - ) + toolsFiltered.map((tool, index) => { + const unavailableOnBranch = tool.branches?.every( + (branch) => + branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH), + ); + const selected = Astro.url.pathname.includes(`/tools/${tool.id}`); + const toolStrings = + strings.website.tools[ + (tool.stringsId ?? + tool.id) as keyof typeof strings.website.tools + ]; + + if (unavailableOnBranch) return null; + + return ( + + {toolStrings.name} + + ); + }) } - - + + + + + + + + + + + + + + + + + + + + + { - toolsFiltered.map((tool, index) => { + toolsFiltered.map((tool) => { const unavailableOnBranch = tool.branches?.every( (branch) => branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH), ); - const selected = Astro.url.pathname.includes(`/tools/${tool.id}`); + + if (unavailableOnBranch) return null; + const toolStrings = strings.website.tools[ (tool.stringsId ?? tool.id) as keyof typeof strings.website.tools ]; - if (unavailableOnBranch) return null; - return ( - - {toolStrings.name} - + + + {toolStrings.name} + + + ); }) } - - - - - - - - - - - - - - - - - - - - - - - - - { - toolsFiltered.map((tool) => { - const unavailableOnBranch = tool.branches?.every( - (branch) => - branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH), - ); - - if (unavailableOnBranch) return null; - - const toolStrings = - strings.website.tools[ - (tool.stringsId ?? tool.id) as keyof typeof strings.website.tools - ]; - - return ( - - - - {toolStrings.name} - - - - ); - }) - } diff --git a/packages/website/src/components/ToolOpenGraph.astro b/packages/website/src/components/ToolOpenGraph.astro index 77b91e842..f53f7d548 100644 --- a/packages/website/src/components/ToolOpenGraph.astro +++ b/packages/website/src/components/ToolOpenGraph.astro @@ -1,4 +1,5 @@ --- +import { AstroSeo } from '@astrolib/seo'; import { imgur } from '@blitzkit/core'; import { type Tool } from '../constants/tools'; import { getStrings } from '../core/i18n/getStrings'; @@ -16,7 +17,16 @@ const toolStrings = ]; --- -{toolStrings.name} - - - + diff --git a/packages/website/src/pages/[...locale]/docs/[directory]/[document]/index.astro b/packages/website/src/pages/[...locale]/docs/[directory]/[document]/index.astro index b3ec6f8e3..47457dbc4 100644 --- a/packages/website/src/pages/[...locale]/docs/[directory]/[document]/index.astro +++ b/packages/website/src/pages/[...locale]/docs/[directory]/[document]/index.astro @@ -1,4 +1,5 @@ --- +import { AstroSeo } from '@astrolib/seo'; import type { GetStaticPaths } from 'astro'; import { readFile } from 'fs/promises'; import BaseLayout from '../../../../../layouts/BaseLayout.astro'; @@ -7,7 +8,6 @@ import { Page } from './_index'; export const getStaticPaths = (async () => { const parentPaths = parentGetStaticPaths(); - const ROOT = '../../../../../../../../docs/'; const files = import.meta.glob('../../../../../../../../docs/**/*.md', { eager: true, @@ -40,7 +40,18 @@ const { content } = Astro.props; const title = content.split('\n')[0].replace('# ', ''); --- -{title} + diff --git a/packages/website/src/pages/[...locale]/docs/patches/index.astro b/packages/website/src/pages/[...locale]/docs/patches/index.astro index b9521e432..02fc24d7c 100644 --- a/packages/website/src/pages/[...locale]/docs/patches/index.astro +++ b/packages/website/src/pages/[...locale]/docs/patches/index.astro @@ -1,15 +1,17 @@ --- +import { AstroSeo } from '@astrolib/seo'; import { MagicWandIcon, StarFilledIcon } from '@radix-ui/react-icons'; import { Flex, Heading, Link } from '@radix-ui/themes'; import { compareVersions } from 'compare-versions'; import { PageWrapper } from '../../../../components/PageWrapper'; +import { getStrings } from '../../../../core/i18n/getStrings'; import BaseLayout from '../../../../layouts/BaseLayout.astro'; export { getStaticPaths } from '../../index.astro'; // this can't be used in template literal :( const ROOT = '../../../../../../../docs/changelogs/'; - +const strings = getStrings(Astro.params.locale); const versions = Object.keys( import.meta.glob('../../../../../../../docs/changelogs/*.md', { eager: true, @@ -20,7 +22,18 @@ const versions = Object.keys( .reverse(); --- -BlitzKit Patches + diff --git a/packages/website/src/pages/[...locale]/index.astro b/packages/website/src/pages/[...locale]/index.astro index 910c4e5c5..fa472916e 100644 --- a/packages/website/src/pages/[...locale]/index.astro +++ b/packages/website/src/pages/[...locale]/index.astro @@ -44,36 +44,14 @@ export const getStaticPaths = (() => { diff --git a/packages/website/src/pages/[...locale]/tools/embed/[embed]/host/index.astro b/packages/website/src/pages/[...locale]/tools/embed/[embed]/host/index.astro index 19dbbcbde..8bf3f08a5 100644 --- a/packages/website/src/pages/[...locale]/tools/embed/[embed]/host/index.astro +++ b/packages/website/src/pages/[...locale]/tools/embed/[embed]/host/index.astro @@ -1,5 +1,4 @@ --- -import { capitalize } from 'lodash-es'; import EmbedLayout from '../../../../../../layouts/EmbedLayout.astro'; import type { getStaticPaths } from '../index.astro'; import { Page } from './_index'; @@ -7,8 +6,6 @@ import { Page } from './_index'; export { getStaticPaths } from '../index.astro'; --- -BlitzKit - {capitalize(Astro.params.embed)} embed - diff --git a/packages/website/src/pages/[...locale]/tools/embed/[embed]/index.astro b/packages/website/src/pages/[...locale]/tools/embed/[embed]/index.astro index 58103ddf6..c161789f6 100644 --- a/packages/website/src/pages/[...locale]/tools/embed/[embed]/index.astro +++ b/packages/website/src/pages/[...locale]/tools/embed/[embed]/index.astro @@ -1,4 +1,5 @@ --- +import { AstroSeo } from '@astrolib/seo'; import type { GetStaticPaths } from 'astro'; import { capitalize } from 'lodash-es'; import { embedConfigurations } from '../../../../../constants/embeds'; @@ -21,10 +22,24 @@ export const getStaticPaths = (() => { .flat(); }) satisfies GetStaticPaths; +const name = capitalize(Astro.params.embed); +const title = `BlitzKit - ${name} embed`; +const description = `BlitzKit ${name} embeds for streaming World of Tanks Blitz with extreme customization`; const { locale } = Astro.params; --- -BlitzKit - {capitalize(Astro.params.embed)} embed +