Why this matters
Related posts improve session depth and strengthen internal linking without introducing a client-side search dependency.
Setup
Score posts by shared category and tag overlap.
const categoryScore = post.data.category === current.data.category ? 2 : 0;
const tagScore = post.data.tags.filter((tag) => current.data.tags.includes(tag)).length;
Implementation notes
Use deterministic rules so the build stays reproducible. This pairs naturally with Obsidian to Astro Workflow.
Final checklist
- Exclude the current post
- Prefer same-category matches
- Limit the related list to keep pages compact