feat(landing): Russian default + SEO head, icons and OG card
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 57s
CI / conformance (pull_request) Successful in 8s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m20s

The landing now always opens in Russian (saved 🌐 choice still wins) —
browser-language detection made the indexed content nondeterministic
(Googlebot renders with en-US). landing.html gains the static Russian
SEO head: title/description, canonical pinned to the production origin,
Open Graph card (Telegram/VK link previews), twitter:card, JSON-LD,
theme-color and the favicon set; the SPA shell turns noindex and its
tab title becomes «Эрудит (Скрэббл)». New assets/icons generator
(same tile design as the VK loader) produces favicon.svg/ico,
apple-touch-icon.png and og-image.png into ui/public/, plus robots.txt.
This commit is contained in:
Ilia Denisov
2026-07-02 01:25:19 +02:00
parent f3e2a6822b
commit 1ed624eaf1
17 changed files with 367 additions and 18 deletions
+21 -8
View File
@@ -2,16 +2,29 @@ import { expect, test } from './fixtures';
// The landing page is a separate Vite entry (landing.html), served at "/" in production while
// the game SPA lives at /app/ and /telegram/. In dev it is reachable at /landing.html.
test('landing shows the pitch, switches language via the dropdown, and toggles theme', async ({ page }) => {
test('landing defaults to Russian, switches language via the dropdown, and toggles theme', async ({ page }) => {
await page.goto('/landing.html');
// The tagline renders (English in the default test browser).
await expect(page.getByText(/Play Scrabble/i)).toBeVisible();
// The language dropdown switches the copy to Russian.
await page.getByRole('button', { name: 'Language' }).click();
await page.getByRole('menuitem', { name: /Русский/ }).click();
// Russian by default regardless of the browser language (the test browser is en-US):
// crawlers render with arbitrary navigator.language, so the landing never auto-detects.
await expect(page.getByText(/Играй в «Эрудита»/)).toBeVisible();
await expect(page).toHaveTitle(/Эрудит \(Скрэббл\)/);
expect(await page.evaluate(() => document.documentElement.lang)).toBe('ru');
// The static SEO head is present (the page is client-rendered; this layer is what
// non-rendering crawlers and link-preview bots see).
expect(await page.locator('meta[name="description"]').getAttribute('content')).toContain('Эрудит');
expect(await page.locator('meta[property="og:image"]').getAttribute('content')).toBe(
'https://erudit-game.ru/og-image.png',
);
const jsonLd = await page.locator('script[type="application/ld+json"]').textContent();
expect(JSON.parse(jsonLd!)['@type']).toBe('WebApplication');
// The language dropdown switches the copy to English, and the document language follows.
await page.getByRole('button', { name: 'Language' }).click();
await page.getByRole('menuitem', { name: /English/ }).click();
await expect(page.getByText(/Play Scrabble/i)).toBeVisible();
expect(await page.evaluate(() => document.documentElement.lang)).toBe('en');
// The theme toggle flips the document theme (ephemeral, light<->dark).
const before = await page.evaluate(() => document.documentElement.getAttribute('data-theme'));
@@ -24,7 +37,7 @@ test('landing shows the pitch, switches language via the dropdown, and toggles t
// adds .app-shell); the landing is a normal scrolling document and must keep scrolling.
test('the landing is a normal scrolling document (the SPA document-pin does not apply)', async ({ page }) => {
await page.goto('/landing.html');
await expect(page.getByText(/Play Scrabble/i)).toBeVisible();
await expect(page.getByText(/Играй в «Эрудита»/)).toBeVisible();
const state = await page.evaluate(() => ({
shell: document.documentElement.classList.contains('app-shell'),