@@ -4,7 +4,7 @@ import Card from "../../components/Card.astro";
44import SectionHeader from " ../../components/SectionHeader.astro" ;
55import { t } from " ../../i18n/utils.ts" ;
66import { getCollection } from " astro:content" ;
7- import { extractSummary , extractTags , TAG_MAP_EN , formatDateCn } from " ../../lib/content.ts" ;
7+ import { extractSummary , extractTags , TAG_MAP_EN , formatWeekDateEn } from " ../../lib/content.ts" ;
88
99const allEn = await getCollection (" en" );
1010const allDaily = allEn .filter ((e ) => e .id .startsWith (" daily/" ));
@@ -22,7 +22,7 @@ function buildCard(article: any, type: "daily" | "weekly") {
2222 return {
2323 type ,
2424 title: article .data .title ,
25- date: formatDateCn (article .data .date ),
25+ date: type === " weekly " ? formatWeekDateEn (article .data .date ) : article . data . date ,
2626 summary: extractSummary (article .body ),
2727 tags: extractTags (article .body , TAG_MAP_EN ),
2828 href: ` /en/${article .id .replace (" .md" , " " )} ` ,
@@ -98,7 +98,7 @@ const recentTopics = topicsList.slice(1, 4).map((a) => ({
9898 <!-- Latest Three -->
9999 { (latestDaily || latestWeekly || latestTopic ) && (
100100 <section class = " mt-8 sm:mt-12" >
101- <SectionHeader title = { t (" home.section_latest" , " en" )} href = " /en/industry" />
101+ <SectionHeader title = { t (" home.section_latest" , " en" )} href = " /en/industry" locale = " en " />
102102 <div class = " grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4" >
103103 { latestDaily && (
104104 <Card type = { latestDaily .type } title = { latestDaily .title } date = { latestDaily .date } summary = { latestDaily .summary } tags = { latestDaily .tags } href = { latestDaily .href } locale = " en" />
@@ -116,7 +116,7 @@ const recentTopics = topicsList.slice(1, 4).map((a) => ({
116116 <!-- Industry News (Daily + Weekly combined) -->
117117 { (recentDaily .length > 0 || recentWeekly .length > 0 ) && (
118118 <section class = " mt-10 sm:mt-14" >
119- <SectionHeader title = { t (" home.section_industry" , " en" )} href = " /en/industry" />
119+ <SectionHeader title = { t (" home.section_industry" , " en" )} href = " /en/industry" locale = " en " />
120120 <div class = " grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4" >
121121 { [... recentDaily .map ((item ) => ({ ... item , type: " daily" as const })), ... recentWeekly .map ((item ) => ({ ... item , type: " weekly" as const }))]
122122 .sort ((a , b ) => b .date .localeCompare (a .date ))
@@ -131,7 +131,7 @@ const recentTopics = topicsList.slice(1, 4).map((a) => ({
131131 <!-- Recent Discussions -->
132132 { recentTopics .length > 0 && (
133133 <section class = " mt-10 sm:mt-14" >
134- <SectionHeader title = { t (" home.section_discussions" , " en" )} href = " /en/topics" accentColor = " pink" />
134+ <SectionHeader title = { t (" home.section_discussions" , " en" )} href = " /en/topics" accentColor = " pink" locale = " en " />
135135 <div class = " grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4" >
136136 { recentTopics .map ((item ) => (
137137 <Card type = { item .type } title = { item .title } date = { item .date } summary = { item .summary } tags = { item .tags } href = { item .href } locale = " en" />
0 commit comments