diff --git a/next.config.ts b/next.config.ts index cb651cd..65c102b 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,5 +1,7 @@ import type { NextConfig } from "next"; -const nextConfig: NextConfig = {}; +const nextConfig: NextConfig = { + output: "export", +}; export default nextConfig; diff --git a/src/app/news/[slug]/page.tsx b/src/app/news/[slug]/page.tsx index e004968..7e36314 100644 --- a/src/app/news/[slug]/page.tsx +++ b/src/app/news/[slug]/page.tsx @@ -1,9 +1,15 @@ import type { Metadata } from "next"; import Link from "next/link"; -import { getNewsBySlug, markdownToHtml } from "@/data/news"; +import { getNewsBySlug, getNewsList, markdownToHtml } from "@/data/news"; import { PageBreadcrumb } from "@/components/layout/page-breadcrumb"; import { NewsShare } from "@/components/news/news-share"; +export async function generateStaticParams() { + const news = await getNewsList(); + + return news.map((item) => ({ slug: item.slug })); +} + export async function generateMetadata({ params, }: {