File tree Expand file tree Collapse file tree 3 files changed +24
-16
lines changed
Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 11import { getPostData , getSortedPostsData } from '@/lib/posts'
22
33export async function generateStaticParams ( ) {
4- const posts = getSortedPostsData ( )
5- return posts . map ( post => ( { slug : post . slug } ) )
6- }
4+ const posts = getSortedPostsData ( ) ;
5+ return posts . map ( post => ( {
6+ slug : post . slug ,
7+ } ) ) ;
8+ }
9+
710
811export default async function Post ( { params } : { params : { slug : string } } ) {
912 const postData = await getPostData ( params . slug )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default function BlogPage() {
1010 < div className = "space-y-4" >
1111 { allPostsData . map ( ( { slug, date, title } ) => (
1212 < article key = { slug } className = "border-b pb-4" >
13- < Link href = { `/blog/${ slug } ` } className = "text-xl font-semibold hover:text-blue-600" >
13+ < Link href = { `/blog/${ slug } / ` } className = "text-xl font-semibold hover:text-blue-600" >
1414 { title }
1515 </ Link >
1616 < p className = "text-sm text-gray-500 mt-1" > { new Date ( date ) . toLocaleDateString ( ) } </ p >
Original file line number Diff line number Diff line change 1- /**
2- * @type {import('next').NextConfig }
3- */
1+ /** @type {import('next').NextConfig } */
42const nextConfig = {
5- output : "export" ,
6- images : {
7- loader : "akamai" ,
8- path : "" ,
9- } ,
10- assetPrefix : "/" ,
11- } ;
12-
13- export default nextConfig ;
3+ output : 'export' ,
4+ trailingSlash : true ,
5+ images : {
6+ unoptimized : true ,
7+ } ,
8+ // Remove the exportPathMap entirely or use this alternative:
9+ async exportPathMap ( ) {
10+ return {
11+ '/' : { page : '/' } ,
12+ '/blog' : { page : '/blog' } ,
13+ // Blog posts will be automatically generated by generateStaticParams
14+ }
15+ }
16+ }
17+
18+ export default nextConfig
You can’t perform that action at this time.
0 commit comments