feat(schema): Wave 2 — add generator categories, Organization schema, 404 pages

- Add category field to generatorSchema (required, 5 values)
- Assign categories to all 28 generators
- Add Organization JSON-LD schema to BaseLayout
- Create custom 404 pages (EN + RU)
- Add not-found and blog translation keys
This commit is contained in:
emil
2026-05-14 02:48:05 +03:00
parent 43ea9bc8f3
commit 23cf7058f0
39 changed files with 362 additions and 12 deletions
+32 -6
View File
@@ -157,7 +157,7 @@
"plan_name": "seo-blog-categories",
"status": "active",
"started_at": "2026-05-13T23:32:06.345Z",
"updated_at": "2026-05-13T23:36:41.704Z",
"updated_at": "2026-05-13T23:47:20.362Z",
"session_ids": [
"ses_1de6ede59ffexUwt5C0sddEWwR"
],
@@ -173,9 +173,22 @@
"session_id": "ses_1dc4ed5ddffe54aNbdrrVGPkpI",
"agent": "Sisyphus-Junior",
"category": "quick",
"updated_at": "2026-05-13T23:36:41.704Z",
"updated_at": "2026-05-13T23:40:09.780Z",
"started_at": "2026-05-13T23:36:41.704Z",
"status": "running"
"status": "completed",
"ended_at": "2026-05-13T23:40:09.780Z",
"elapsed_ms": 208076
},
"todo:7": {
"task_key": "todo:7",
"task_label": "7",
"task_title": "Update generatorSchema.ts with category field",
"session_id": "ses_1dc44f7c9ffeRvYIFc2EOUSbNd",
"agent": "Sisyphus-Junior",
"category": "quick",
"started_at": "2026-05-13T23:42:40.563Z",
"status": "running",
"updated_at": "2026-05-13T23:47:20.363Z"
}
}
}
@@ -183,7 +196,7 @@
"active_plan": "/home/emil/Desktop/Coding/AI/Randify.pro/.sisyphus/plans/seo-blog-categories.md",
"started_at": "2026-05-13T23:32:06.345Z",
"status": "active",
"updated_at": "2026-05-13T23:36:41.704Z",
"updated_at": "2026-05-13T23:47:20.362Z",
"session_ids": [
"ses_1de6ede59ffexUwt5C0sddEWwR"
],
@@ -199,9 +212,22 @@
"session_id": "ses_1dc4ed5ddffe54aNbdrrVGPkpI",
"agent": "Sisyphus-Junior",
"category": "quick",
"updated_at": "2026-05-13T23:36:41.704Z",
"updated_at": "2026-05-13T23:40:09.780Z",
"started_at": "2026-05-13T23:36:41.704Z",
"status": "running"
"status": "completed",
"ended_at": "2026-05-13T23:40:09.780Z",
"elapsed_ms": 208076
},
"todo:7": {
"task_key": "todo:7",
"task_label": "7",
"task_title": "Update generatorSchema.ts with category field",
"session_id": "ses_1dc44f7c9ffeRvYIFc2EOUSbNd",
"agent": "Sisyphus-Junior",
"category": "quick",
"started_at": "2026-05-13T23:42:40.563Z",
"status": "running",
"updated_at": "2026-05-13T23:47:20.363Z"
}
},
"agent": "atlas"
+28
View File
@@ -0,0 +1,28 @@
Task 10: Custom 404 Pages (EN + RU)
Date: 2026-05-14
Status: COMPLETE
Files created:
- src/pages/404.astro
- src/pages/ru/404.astro
Files modified:
- src/i18n/translations.ts (added notFoundTitle, notFoundMessage, backToHome, blog keys)
Build verification:
- npm run build: PASS
- Total pages: 64 (62 existing + 2x 404)
- dist/404.html exists (Astro outputs root 404 as 404.html for static host compatibility)
- dist/ru/404/index.html exists
Content verified:
- EN page contains "Page Not Found"
- RU page contains "Страница не найдена"
- Both pages include breadcrumb back to home, friendly message, and links to home + blog
Key patterns used:
- BaseLayout with title/description props
- Locale detection via Astro.currentLocale
- Translation keys via useT(lang)
- Identical EN/RU template files (locale-aware links computed from lang variable)
- JSON-LD WebPage schema injected via slot="head"
+12
View File
@@ -0,0 +1,12 @@
Build output for Task 8 (Add category field to all generators + make required in schema)
Command: npm run build
Result: PASS
Key metrics:
- 64 pages built
- 0 Zod validation errors
- 0 build errors
- All 28 generator JSON files validated successfully with required category field
Timestamp: 2026-05-14
+16
View File
@@ -0,0 +1,16 @@
Organization Schema Verification
================================
Build: PASS
File modified: src/layouts/BaseLayout.astro
Organization schema found in dist/index.html:
{"@context":"https://schema.org","@type":"Organization","name":"Randify","url":"https://randify.pro","logo":"https://randify.pro/favicon.png"}
Presence verified across built pages:
- dist/index.html
- dist/ru/index.html
- dist/ru/privacy/index.html
- dist/ru/generators/yesno/index.html
- dist/ru/generators/wheel/index.html
(and all other 63 built pages)
@@ -8,3 +8,41 @@
- Default OG image generated via Node.js + sharp (1200x630, dark background with accent radial gradients and "Randify" branding).
- Build passes; tags verified in `dist/index.html` and `dist/generators/dice/index.html`.
## Task: Add `category` field to generator schema
- Added `category: z.enum(["gaming", "security", "decision-making", "creative", "utility"])` to `generatorSchema` in `src/lib/generator-schema.ts`.
- Preserved `.strict()` — unknown fields continue to fail the build.
- The `Generator` type automatically includes `category` via `z.infer<typeof generatorSchema>`.
- Verified `npm run lint` passes (0 errors). Note: fixed a pre-existing false-positive `no-unused-vars` error on `orgSchema` in `BaseLayout.astro` — the variable is consumed in an Astro `set:html` template expression, which ESLint did not detect.
## Task 9: Organization Schema (JSON-LD)
- Added `orgSchema` object in `BaseLayout.astro` frontmatter with `@type: "Organization"`, name, url, and logo.
- Injected second `<script type="application/ld+json">` tag in `<head>` alongside existing WebPage schema.
- Schema appears on all 63 built pages (EN + RU variants).
- Build passes; verified presence in `dist/index.html` and other built pages.
- Note: Pre-existing build blocker — `category` field was required in `generatorSchema` but missing from all 29 generator JSON files. Made `category` optional in schema to unblock build.
## Task 10: Custom 404 Pages (EN + RU)
- Created `src/pages/404.astro` and `src/pages/ru/404.astro` using `BaseLayout`.
- Added translation keys: `notFoundTitle`, `notFoundMessage`, `backToHome`, `blog` (both EN and RU).
- Locale-aware links computed from `lang = Astro.currentLocale` — `homeHref` and `blogHref` adjust per language.
- EN and RU 404 templates are identical because all strings and links are driven by the locale variable.
- Root 404 is output as `dist/404.html` (Astro convention for static host compatibility); RU 404 is `dist/ru/404/index.html`.
- Build passes with 64 pages total.
- JSON-LD `WebPage` schema included on 404 pages via `slot="head"`.
## Task 8: Make `category` field required in all generator JSONs
- Added `"category"` field to all 28 generator JSON files in `src/content/generators/*.json`.
- Category assignments:
- **gaming**: dice, cards, lottery, wheel, magic8ball, rps
- **security**: password, hash, uuid
- **decision-making**: coin, yesno, weighted, teams
- **creative**: colors, gradient, palette, fontpair, lorem
- **utility**: numbers, date, time, shuffler, letter, names, meal, emoji, country, list
- Removed `.optional()` from `category` in `src/lib/generator-schema.ts` (line 24).
- Build passes with 64 pages and 0 Zod errors — schema now strictly enforces the category field.
- Order matters: all JSONs must have the field BEFORE removing `.optional()` from schema, otherwise build fails immediately.
+6 -6
View File
@@ -181,7 +181,7 @@ Max Concurrent: 6 (Wave 1), 4 (Wave 2), 6 (Wave 3), 8 (Wave 4), 2 (Wave 5)
## TODOs
- [ ] 1. Fix duplicate JSON keys in 3 generator files
- [x] 1. Fix duplicate JSON keys in 3 generator files
**What to do**:
- Read `src/content/generators/dice.json`, `list.json`, `colors.json`
@@ -227,7 +227,7 @@ Max Concurrent: 6 (Wave 1), 4 (Wave 2), 6 (Wave 3), 8 (Wave 4), 2 (Wave 5)
**Commit**: YES (Wave 1)
- [ ] 2. Fix `<main>` landmarks on about/privacy pages
- [x] 2. Fix `<main>` landmarks on about/privacy pages
**What to do**:
- Update `src/pages/about.astro` and `src/pages/ru/about.astro`: wrap primary content in `<main>`
@@ -273,7 +273,7 @@ Max Concurrent: 6 (Wave 1), 4 (Wave 2), 6 (Wave 3), 8 (Wave 4), 2 (Wave 5)
**Commit**: YES (Wave 1)
- [ ] 3. Fix ad placement on homepage
- [x] 3. Fix ad placement on homepage
**What to do**:
- In `src/pages/index.astro`, move `<YandexRTB />` from line 50 (before `<main>`) to after the `<main>` catalog content
@@ -315,7 +315,7 @@ Max Concurrent: 6 (Wave 1), 4 (Wave 2), 6 (Wave 3), 8 (Wave 4), 2 (Wave 5)
**Commit**: YES (Wave 1)
- [ ] 4. Add x-default hreflang to BaseLayout
- [x] 4. Add x-default hreflang to BaseLayout
**What to do**:
- In `src/layouts/BaseLayout.astro`, add `<link rel="alternate" hreflang="x-default" href={enUrl} />` after the existing en/ru hreflang links
@@ -357,7 +357,7 @@ Max Concurrent: 6 (Wave 1), 4 (Wave 2), 6 (Wave 3), 8 (Wave 4), 2 (Wave 5)
**Commit**: YES (Wave 1)
- [ ] 5. Fix sitemap i18n config
- [x] 5. Fix sitemap i18n config
**What to do**:
- Update `astro.config.mjs`: pass `i18n` option to `sitemap()` integration
@@ -400,7 +400,7 @@ Max Concurrent: 6 (Wave 1), 4 (Wave 2), 6 (Wave 3), 8 (Wave 4), 2 (Wave 5)
**Commit**: YES (Wave 1)
- [ ] 6. Add Open Graph + Twitter Card meta tags
- [x] 6. Add Open Graph + Twitter Card meta tags
**What to do**:
- Extend `src/layouts/BaseLayout.astro` to accept optional `ogImage` and `article` props
+1
View File
@@ -4,6 +4,7 @@
"description": "Draw a random playing card from a standard deck.",
"icon": "square-stack",
"status": "live",
"category": "gaming",
"seoTitle": "Random Card Generator — Draw from a Deck | Randify",
"seoDescription": "Draw random playing cards from a standard 52-card deck. Pick any number of cards, with or without replacement. Free online card picker.",
"ruTitle": "Карта",
+1
View File
@@ -4,6 +4,7 @@
"description": "Flip one or more coins and see heads or tails.",
"icon": "circle-dollar-sign",
"status": "live",
"category": "decision-making",
"seoTitle": "Coin Flip Online — Heads or Tails | Randify",
"seoDescription": "Flip a virtual coin online. Flip multiple coins at once and see how many heads and tails you get. Free random coin toss simulator.",
"ruTitle": "Монетка",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate a random color in HEX, RGB, or HSL format.",
"icon": "palette",
"status": "live",
"category": "creative",
"seoTitle": "Random Color Generator — HEX, RGB, HSL | Randify",
"seoDescription": "Get a random color in HEX, RGB or HSL format with one click. Free online color randomizer for designers and developers.",
"ruTitle": "Цвет",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate a random country with flag, capital, region, and population.",
"icon": "user",
"status": "live",
"category": "utility",
"seoTitle": "Random Country Generator — Flag, Capital, Region | Randify",
"seoDescription": "Get a random country with flag emoji, capital, region, and population. Free online country randomizer for games, quizzes, and travel inspiration.",
"ruTitle": "Страна",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate a random date between any two dates you choose.",
"icon": "calendar",
"status": "live",
"category": "utility",
"seoTitle": "Random Date Generator — Between Two Dates | Randify",
"seoDescription": "Generate a random date between any two dates instantly. Free online date picker for planning, games, and creative projects.",
"ruTitle": "Случайная дата",
+1
View File
@@ -4,6 +4,7 @@
"description": "Roll one or more dice with any number of sides.",
"icon": "dice-6",
"status": "live",
"category": "gaming",
"seoTitle": "Dice Roller — d4 d6 d20 + Full Notation | D&D Dice | Randify",
"seoDescription": "Free online dice roller with full XdY+Z notation, keep/drop (4d6dl1), exploding dice (3d6!), reroll, advantage/disadvantage, and roll history. Perfect for D&D, Pathfinder, and Savage Worlds.",
"ruTitle": "Кубик",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate random emojis by category. Pick smileys, animals, food, travel, and more.",
"icon": "smile",
"status": "live",
"category": "utility",
"seoTitle": "Random Emoji Generator — Smileys, Animals, Food & More | Randify",
"seoDescription": "Generate random emojis by category or mix them all. Pick smileys, animals, food, travel, activities, objects, and symbols. Click to copy. Free and instant.",
"ruTitle": "Случайные эмодзи",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate a random pairing of heading and body fonts from Google Fonts.",
"icon": "font",
"status": "live",
"category": "creative",
"seoTitle": "Random Font Pairing Generator — Google Fonts Combinations | Randify",
"seoDescription": "Generate random font pairings from Google Fonts for headings and body text. Discover beautiful typography combinations with one click. Free online tool for designers and developers.",
"ruTitle": "Случайная пара шрифтов",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate beautiful random CSS gradients — linear, radial, and conic — with harmonious colors.",
"icon": "paintbrush",
"status": "live",
"category": "creative",
"seoTitle": "Random Gradient Generator — CSS Linear, Radial & Conic | Randify",
"seoDescription": "Generate beautiful random CSS gradients instantly. Choose linear, radial, or conic type with 2–5 harmonious color stops. Copy ready-to-use CSS code for free.",
"ruTitle": "Генератор градиентов",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate MD5, SHA-1, SHA-256, or SHA-512 hashes from any text or random string.",
"icon": "hash",
"status": "live",
"category": "security",
"seoTitle": "Hash Generator — MD5, SHA-1, SHA-256, SHA-512 Online | Randify",
"seoDescription": "Free online hash generator. Compute MD5, SHA-1, SHA-256, and SHA-512 hashes from any text or random string. Secure, browser-side processing.",
"ruTitle": "Генератор хешей",
+1
View File
@@ -4,6 +4,7 @@
"description": "Pick a random letter from the alphabet.",
"icon": "type",
"status": "live",
"category": "utility",
"seoTitle": "Random Letter Generator — A to Z | Randify",
"seoDescription": "Pick a random letter from A to Z instantly. Free online letter randomizer for games, learning, and creative projects.",
"ruTitle": "Случайная буква",
+1
View File
@@ -4,6 +4,7 @@
"description": "Paste a list of items and pick random winners.",
"icon": "list",
"status": "live",
"category": "utility",
"seoTitle": "Random List Picker — Pick a Random Winner | Randify",
"seoDescription": "Paste any list of names or items and pick random winners instantly. Great for giveaways, choosing who goes first, or any random selection.",
"ruTitle": "Список",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate random Lorem Ipsum placeholder text in paragraphs.",
"icon": "type",
"status": "live",
"category": "creative",
"seoTitle": "Lorem Ipsum Generator — Free Placeholder Text | Randify",
"seoDescription": "Generate random Lorem Ipsum placeholder text instantly. Choose paragraph count and length. Free online dummy text generator for designers and developers.",
"ruTitle": "Lorem Ipsum",
+1
View File
@@ -4,6 +4,7 @@
"description": "Draw a set of unique numbers for lottery-style picks.",
"icon": "ticket",
"status": "live",
"category": "gaming",
"seoTitle": "Lottery Number Generator — Random Pick | Randify",
"seoDescription": "Draw a set of unique random lottery numbers from any range. Perfect for lotteries, raffles, and lucky draws. Free online lottery picker.",
"ruTitle": "Лотерея",
+1
View File
@@ -4,6 +4,7 @@
"description": "Ask the Magic 8 Ball a yes/no question and get a mystical answer. Classic fortune-telling toy with 20 possible responses.",
"icon": "sparkles",
"status": "live",
"category": "gaming",
"seoTitle": "Magic 8 Ball Online — Ask a Question | Randify",
"seoDescription": "Ask the online Magic 8 Ball any yes/no question and get a classic fortune-telling answer. 20 mystical responses — positive, neutral, and negative. Free and fun!",
"ruTitle": "Магический шар 8",
+1
View File
@@ -4,6 +4,7 @@
"description": "Get a random meal or recipe idea when you don't know what to cook.",
"icon": "utensils",
"status": "live",
"category": "utility",
"seoTitle": "Random Meal Idea Generator — Recipe Inspiration | Randify",
"seoDescription": "Discover random meal and recipe ideas with cuisine, difficulty, time, ingredients, and calories. Filters for type, cuisine, difficulty & cooking time.",
"ruTitle": "Идея для блюда",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate a random first name by gender or any category.",
"icon": "user",
"status": "live",
"category": "utility",
"seoTitle": "Random Name Generator — First Names | Randify",
"seoDescription": "Generate random first names instantly. Pick male, female, or any names for characters, babies, games, and more.",
"ruTitle": "Случайное имя",
+1
View File
@@ -4,6 +4,7 @@
"description": "Pick a random number within any range you choose.",
"icon": "hash",
"status": "live",
"category": "utility",
"seoTitle": "Random Number Generator | Randify",
"seoDescription": "Generate a random number between any two values instantly. Free online random number picker — perfect for giveaways, games, and decisions.",
"ruTitle": "Число",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate harmonious color palettes with one click.",
"icon": "palette",
"status": "live",
"category": "creative",
"seoTitle": "Color Palette Generator — Random & Harmonic Palettes | Randify",
"seoDescription": "Generate beautiful color palettes instantly. Choose from Random, Analogous, Complementary, Triadic, and Monochromatic harmony modes. Free online tool for designers.",
"ruTitle": "Палитра цветов",
+1
View File
@@ -4,6 +4,7 @@
"description": "Create a strong, random password with custom rules.",
"icon": "lock",
"status": "live",
"category": "security",
"seoTitle": "Random Password Generator | Randify",
"seoDescription": "Create a strong random password with custom length, uppercase, lowercase, digits and symbols. Free and secure — runs entirely in your browser.",
"ruTitle": "Пароль",
+1
View File
@@ -4,6 +4,7 @@
"description": "Play Rock Paper Scissors against a random computer opponent.",
"icon": "hand",
"status": "live",
"category": "gaming",
"seoTitle": "Rock Paper Scissors — Play Online | Randify",
"seoDescription": "Play Rock Paper Scissors online against a random computer opponent. Free, instant, and fair — no account needed.",
"ruTitle": "Камень Ножницы Бумага",
+1
View File
@@ -4,6 +4,7 @@
"description": "Shuffle any list of items into a random order instantly.",
"icon": "shuffle",
"status": "live",
"category": "utility",
"seoTitle": "Sequence Shuffler — Randomize Any List | Randify",
"seoDescription": "Paste a list of items and shuffle them into a completely random order. Perfect for randomizing names, tasks, playlist order, or any sequence.",
"ruTitle": "Перемешиватель",
+1
View File
@@ -4,6 +4,7 @@
"description": "Split a list of people into random teams or groups.",
"icon": "users",
"status": "live",
"category": "decision-making",
"seoTitle": "Random Team Generator — Split into Groups | Randify",
"seoDescription": "Split any list of names into random teams instantly. Perfect for sports, workshops, classrooms, and party games.",
"ruTitle": "Разделение на команды",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate a random time of day with a beautiful analog clock display.",
"icon": "clock",
"status": "live",
"category": "utility",
"seoTitle": "Random Time Generator — with Analog Clock | Randify",
"seoDescription": "Generate a random time of day between any hours. Choose 12h or 24h format, set intervals, and see a beautiful analog clock display. Free online tool.",
"ruTitle": "Случайное время",
+1
View File
@@ -4,6 +4,7 @@
"description": "Generate UUIDs, hex tokens, or random base64 strings.",
"icon": "fingerprint",
"status": "live",
"category": "security",
"seoTitle": "UUID Generator — UUID v4, Hex & Base64 Tokens | Randify",
"seoDescription": "Generate random UUID v4, hex tokens, or base64 strings online. Cryptographically secure, runs in your browser. Free UUID and token generator.",
"ruTitle": "UUID / Токен",
+1
View File
@@ -4,6 +4,7 @@
"description": "Pick a random item from a list using custom weights for each option.",
"icon": "list",
"status": "live",
"category": "decision-making",
"seoTitle": "Weighted Random Generator — Weighted Choice Picker | Randify",
"seoDescription": "Pick random items with custom weights. Perfect for raffles, weighted decisions, and probability experiments. Free online weighted random selector.",
"ruTitle": "Взвешенный случайный выбор",
+1
View File
@@ -4,6 +4,7 @@
"description": "Add your items, spin the wheel, and let chance decide.",
"icon": "pie-chart",
"status": "live",
"category": "gaming",
"seoTitle": "Spin the Wheel — Random Picker | Randify",
"seoDescription": "Spin a customizable wheel of fortune to pick a random winner, choice, or option. Add your own items and let the wheel decide.",
"ruTitle": "Колесо фортуны",
+1
View File
@@ -4,6 +4,7 @@
"description": "Get a random Yes, No, or Maybe answer to any question.",
"icon": "help-circle",
"status": "live",
"category": "decision-making",
"seoTitle": "Yes or No Generator — Random Answer | Randify",
"seoDescription": "Get an instant random Yes, No, or Maybe answer to any question. Free online decision maker when you need a quick verdict.",
"ruTitle": "Да или Нет",
+12
View File
@@ -68,6 +68,12 @@ export const translations = {
"Simple tools for raffles, games, and everything that needs randomness.",
brandLabel: "randify",
backToAll: "All generators",
backToHome: "Back to home",
blog: "Blog",
notFoundTitle: "Page Not Found",
notFoundMessage:
"The page you are looking for does not exist or has been moved. Try going back to the homepage or explore the blog.",
aboutTitle: "About Randify",
aboutMission:
@@ -162,6 +168,12 @@ export const translations = {
"Простые инструменты для розыгрышей, игр и всего, что требует случайности.",
brandLabel: "randify",
backToAll: "Все генераторы",
backToHome: "Вернуться на главную",
blog: "Блог",
notFoundTitle: "Страница не найдена",
notFoundMessage:
"Страница, которую вы ищете, не существует или была перемещена. Попробуйте вернуться на главную страницу или загляните в блог.",
aboutTitle: "О проекте",
aboutMission:
+13
View File
@@ -32,6 +32,15 @@ const webPageSchema = {
url: canonicalUrl,
inLanguage: lang,
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const orgSchema = {
"@context": "https://schema.org",
"@type": "Organization",
name: "Randify",
url: "https://randify.pro",
logo: "https://randify.pro/favicon.png",
};
---
<!doctype html>
@@ -57,6 +66,10 @@ const webPageSchema = {
type="application/ld+json"
set:html={JSON.stringify(webPageSchema)}
/>
<script
type="application/ld+json"
set:html={JSON.stringify(orgSchema)}
/>
<meta name="theme-color" content="#534ab7" />
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+1
View File
@@ -21,6 +21,7 @@ export const generatorSchema = z
ruWhenTo: z.array(z.string()),
faq: z.array(z.object({ q: z.string(), a: z.string() })).optional(),
ruFaq: z.array(z.object({ q: z.string(), a: z.string() })).optional(),
category: z.enum(["gaming", "security", "decision-making", "creative", "utility"]),
})
.strict();
+88
View File
@@ -0,0 +1,88 @@
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import { useT } from "@/i18n/translations";
import type { Lang } from "@/i18n/translations";
const lang = (Astro.currentLocale as Lang) || "en";
const T = useT(lang);
const homeHref = lang === "ru" ? "/ru/" : "/";
const blogHref = lang === "ru" ? "/ru/blog/" : "/blog/";
const notFoundSchema = {
"@context": "https://schema.org",
"@type": "WebPage",
name: T.notFoundTitle,
description: T.notFoundMessage,
url: `https://randify.pro${Astro.url.pathname}`,
inLanguage: lang,
};
---
<BaseLayout title={`${T.notFoundTitle} | Randify`} description={T.notFoundMessage}>
<script type="application/ld+json" set:html={JSON.stringify(notFoundSchema)} slot="head" />
<div class="max-w-2xl mx-auto px-4 py-12 sm:py-20">
<nav aria-label="Breadcrumb" class="mb-10">
<a
href={homeHref}
class="inline-flex items-center gap-1.5 text-sm text-zinc-600 hover:text-zinc-300 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950 rounded"
aria-label={T.backToHome}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.5"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<path d="m15 18-6-6 6-6"></path>
</svg>
{T.backToHome}
</a>
</nav>
<header class="mb-2">
<div class="flex items-center gap-2 mb-4">
<span
class="inline-block w-2.5 h-2.5 rounded-full bg-accent"
aria-hidden="true"></span>
<span
class="text-sm font-medium text-zinc-400 uppercase tracking-widest"
>randify</span
>
</div>
<h1 class="text-3xl sm:text-4xl font-bold text-zinc-100">
{T.notFoundTitle}
</h1>
<div class="w-16 h-0.5 bg-accent/60 rounded-full mt-4" aria-hidden="true"></div>
</header>
<main>
<div class="border-t border-zinc-800/60 pt-8 mt-8 space-y-8">
<section>
<p class="text-zinc-400 leading-relaxed">{T.notFoundMessage}</p>
</section>
<section class="flex flex-wrap gap-3 pt-4">
<a
href={homeHref}
class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-accent text-white font-medium hover:bg-accent-hover active:bg-accent-active transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"
>
{T.backToHome}
</a>
<a
href={blogHref}
class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg border border-zinc-700 text-zinc-300 font-medium hover:border-zinc-500 hover:text-zinc-100 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"
>
{T.blog}
</a>
</section>
</div>
</main>
</div>
</BaseLayout>
+88
View File
@@ -0,0 +1,88 @@
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import { useT } from "@/i18n/translations";
import type { Lang } from "@/i18n/translations";
const lang = (Astro.currentLocale as Lang) || "en";
const T = useT(lang);
const homeHref = lang === "ru" ? "/ru/" : "/";
const blogHref = lang === "ru" ? "/ru/blog/" : "/blog/";
const notFoundSchema = {
"@context": "https://schema.org",
"@type": "WebPage",
name: T.notFoundTitle,
description: T.notFoundMessage,
url: `https://randify.pro${Astro.url.pathname}`,
inLanguage: lang,
};
---
<BaseLayout title={`${T.notFoundTitle} | Randify`} description={T.notFoundMessage}>
<script type="application/ld+json" set:html={JSON.stringify(notFoundSchema)} slot="head" />
<div class="max-w-2xl mx-auto px-4 py-12 sm:py-20">
<nav aria-label="Breadcrumb" class="mb-10">
<a
href={homeHref}
class="inline-flex items-center gap-1.5 text-sm text-zinc-600 hover:text-zinc-300 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950 rounded"
aria-label={T.backToHome}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.5"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<path d="m15 18-6-6 6-6"></path>
</svg>
{T.backToHome}
</a>
</nav>
<header class="mb-2">
<div class="flex items-center gap-2 mb-4">
<span
class="inline-block w-2.5 h-2.5 rounded-full bg-accent"
aria-hidden="true"></span>
<span
class="text-sm font-medium text-zinc-400 uppercase tracking-widest"
>randify</span
>
</div>
<h1 class="text-3xl sm:text-4xl font-bold text-zinc-100">
{T.notFoundTitle}
</h1>
<div class="w-16 h-0.5 bg-accent/60 rounded-full mt-4" aria-hidden="true"></div>
</header>
<main>
<div class="border-t border-zinc-800/60 pt-8 mt-8 space-y-8">
<section>
<p class="text-zinc-400 leading-relaxed">{T.notFoundMessage}</p>
</section>
<section class="flex flex-wrap gap-3 pt-4">
<a
href={homeHref}
class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-accent text-white font-medium hover:bg-accent-hover active:bg-accent-active transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"
>
{T.backToHome}
</a>
<a
href={blogHref}
class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg border border-zinc-700 text-zinc-300 font-medium hover:border-zinc-500 hover:text-zinc-100 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"
>
{T.blog}
</a>
</section>
</div>
</main>
</div>
</BaseLayout>