feat: show 4 related posts; title-case 'Related Posts'
Deploy / build (push) Successful in 37s

This commit is contained in:
2026-09-09 07:37:53 +08:00
parent 98b50af6be
commit 618b01e4bd
+2 -2
View File
@@ -35,7 +35,7 @@ const related = all
})
.filter((r) => r.score > 0)
.sort((a, b) => b.score - a.score)
.slice(0, 3)
.slice(0, 4)
.map((r) => r.post);
// Translation link for the language switch:
@@ -87,7 +87,7 @@ const switchHref = translation ? `/posts/${translation}/` : undefined;
{related.length > 0 && (
<section class="related">
<h2>{lang === 'zh' ? '相关文章' : 'Related posts'}</h2>
<h2>{lang === 'zh' ? '相关文章' : 'Related Posts'}</h2>
<div class="related-grid">
{related.map((p) => (
<a class="related-card" href={`/posts/${p.slug}/`}>