import Navbar from '../components/Navbar'; import NewsList from '../components/NewsList'; import Footer from '../components/Footer'; import type { GetStaticProps } from 'next'; import { getAllNews, NewsItem } from '../lib/content'; import { Calendar, Newspaper, TrendingUp } from 'lucide-react'; export default function NewsPage({ news }: { news: NewsItem[] }) { // 统计新闻数据 const totalNews = news.length; const recentNews = news.slice(0, 3); const categories = Array.from(new Set(news.flatMap(item => item.tags || []))); return (
{/* 页面标题部分 */}

新闻资讯

了解最新的产品动态、技术更新和行业资讯,掌握云加速服务的最新发展

{/* 统计信息 */}
{totalNews}

新闻资讯

{categories.length}

分类标签

实时

更新状态

{/* 最新资讯预览 */} {recentNews.length > 0 && (

最新资讯

{recentNews.map((item, index) => (
最新

{item.title}

{item.summary && (

{item.summary}

)} {item.tags && item.tags.length > 0 && (
{item.tags.slice(0, 2).map(tag => ( {tag} ))}
)}
))}
)} {/* 新闻列表 */}
); } export const getStaticProps: GetStaticProps = async () => { const news = getAllNews(); return { props: { news } }; }