Files
Randify.pro/.sisyphus/evidence/task-21-related-posts.txt
T
emil 25fd24d236 feat(blog+categories): Wave 3-5 — blog infrastructure, categories, content, navigation
- Install @astrojs/rss and setup content collections (blog + generators)
- Create BlogLayout with BlogPosting schema, article OG tags, prev/next nav
- Create blog post pages EN/RU ([slug].astro) with dynamic routing
- Create blog index pages EN/RU with post cards and filtering
- Create RSS feeds EN/RU with auto-discovery links
- Create generator category pages EN/RU (5 categories each)
- Add category navigation pills to homepage
- Create Breadcrumbs, RelatedGenerators, RelatedPosts components
- Add breadcrumbs to GeneratorLayout and BlogLayout
- Wire RelatedGenerators into GeneratorLayout
- Wire RelatedPosts into blog post pages
- Create 8 EN + 8 RU blog post templates with placeholder content
- Add blog link to LanguageSwitcher navigation
- Add category and blog translation keys
2026-05-14 03:19:06 +03:00

25 lines
937 B
Plaintext

Task 21: RelatedPosts Component
================================
Files created:
- src/components/RelatedPosts.astro
Files modified:
- src/i18n/translations.ts (added relatedPosts key: en="Related posts", ru="Похожие статьи")
- src/pages/blog/[slug].astro (imported RelatedPosts, wired into "related" slot)
- src/pages/ru/blog/[slug].astro (imported RelatedPosts, wired into "related" slot)
Build result: PASS
- 83 pages built successfully
- No errors or warnings
Implementation details:
- Accepts post: CollectionEntry<"blog">
- Uses getCollection to fetch non-draft posts in same language
- Scores related posts by tag overlap count
- Shows top 3 posts with score > 0
- Hides section entirely if no related posts found
- Renders title, date, and description snippet for each related post
- Links use correct /blog/ or /ru/blog/ base path
- Styled with Tailwind matching existing dark theme (zinc palette, accent color)