diff --git a/src/features/tech-log/presentation/public/pages/home-page.tsx b/src/features/tech-log/presentation/public/pages/home-page.tsx index 3a84b0b..8b28835 100644 --- a/src/features/tech-log/presentation/public/pages/home-page.tsx +++ b/src/features/tech-log/presentation/public/pages/home-page.tsx @@ -131,9 +131,11 @@ async function getFeaturedTopic( publicContent: PublicContentQueries, ): Promise { const topics = await publicContent.listTopics(); - const first = topics[0]; - if (!first) return null; - const detail = await publicContent.getTopicDetail(first.slug); + // 목록의 순서는 서버가 정한다. 「가장 많이 다룬」은 여기서 직접 골라야 하는 것이고, + // 첫 항목을 쓰면 기록 3편짜리 주제가 18편짜리를 제치고 홈에 오른다. + const featured = [...topics].sort((left, right) => right.recordCount - left.recordCount)[0]; + if (!featured) return null; + const detail = await publicContent.getTopicDetail(featured.slug); return detail && detail.variants.length > 1 ? detail : null; }