diff --git a/src/app/[locale]/timeline/page.tsx b/src/app/[locale]/timeline/page.tsx new file mode 100644 index 0000000..6d52c6c --- /dev/null +++ b/src/app/[locale]/timeline/page.tsx @@ -0,0 +1,157 @@ +import { getAIEvents } from '@/hooks/useAIEvents'; +import { Metadata } from 'next'; + +export const revalidate = 3600; // ISR 1小时 + +export async function generateMetadata({ + params, +}: { + params: Promise<{ locale: string }>; +}): Promise { + const { locale } = await params; + + return { + title: locale === 'zh' ? 'AI 发展时间轴' : 'AI Timeline', + description: locale === 'zh' + ? '探索人工智能大语言模型的发展历程,从 2017 年 Transformer 到今天' + : 'Explore the evolution of AI large language models from 2017 Transformer to today', + }; +} + +export default async function TimelinePage() { + const events = await getAIEvents(); + + // 按年份分组 + const eventsByYear = events.reduce((acc, event) => { + const year = new Date(event.eventDate).getFullYear(); + if (!acc[year]) { + acc[year] = []; + } + acc[year].push(event); + return acc; + }, {} as Record); + + // 按年份降序排序 + const sortedYears = Object.keys(eventsByYear) + .map(Number) + .sort((a, b) => b - a); + + if (events.length === 0) { + return ( +
+
+

+ 暂无数据 +

+

+ 时间轴数据正在收集中... +

+
+
+ ); + } + + return ( +
+ {/* Header */} +
+
+

+ AI 发展时间轴 +

+

+ 从 Transformer 到 AGI: 大语言模型的进化之路 +

+
+
+ + {/* Timeline */} +
+ {sortedYears.map((year, index) => ( +
+ {/* Year Label */} +
+
+ + {year} + +
+
+ + {/* Events Container */} +
+
+ {eventsByYear[year].map((event, eventIndex) => ( +
+ {/* Tape decoration */} +
+ + {/* Image */} +
+ {event.title} +
+ + {/* Content */} +

+ {event.title} +

+

+ {event.description} +

+ + {/* Date */} +
+ {new Date(event.eventDate).toLocaleDateString('zh-CN')} +
+ + {/* Source Link */} + {event.sourceUrl && ( + + 来源 → + + )} +
+ ))} +
+
+
+ ))} +
+
+ ); +}