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