File tree Expand file tree Collapse file tree 9 files changed +25
-28
lines changed
Expand file tree Collapse file tree 9 files changed +25
-28
lines changed Original file line number Diff line number Diff line change 22/// <reference types="next/image-types/global" />
33
44// NOTE: This file should not be edited
5- // see https://nextjs.org/docs/basic-features /typescript for more information.
5+ // see https://nextjs.org/docs/app/api-reference/config /typescript for more information.
Original file line number Diff line number Diff line change @@ -9,12 +9,13 @@ import { H1_ID } from '../../../../constants';
99import { MarkdocRenderer } from '../../../../components/markdoc-renderer' ;
1010
1111type BlogProps = {
12- params : { slug : string [ ] } ;
12+ params : Promise < { slug : string [ ] } > ;
1313} ;
1414
1515export const dynamicParams = false ;
1616
17- export default async function BlogPost ( { params } : BlogProps ) {
17+ export default async function BlogPost ( props : BlogProps ) {
18+ const params = await props . params ;
1819 const { slug : slugPath } = params ;
1920 const slug = slugPath . join ( '/' ) ;
2021
@@ -94,10 +95,8 @@ export async function generateStaticParams() {
9495 } ) ) ;
9596}
9697
97- export async function generateMetadata (
98- { params } : BlogProps ,
99- parent : ResolvingMetadata
100- ) : Promise < Metadata > {
98+ export async function generateMetadata ( props : BlogProps , parent : ResolvingMetadata ) : Promise < Metadata > {
99+ const params = await props . params ;
101100 const slugPath = params . slug ;
102101 const slug = slugPath . join ( '/' ) ;
103102
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { RenderableTreeNode, Tag } from '@markdoc/markdoc';
1111import { transformMarkdoc } from '../../../../../keystatic.config' ;
1212
1313type DocsProps = {
14- params : { slug : string [ ] } ;
14+ params : Promise < { slug : string [ ] } > ;
1515} ;
1616
1717function stringifyDocContent ( node : RenderableTreeNode ) : string {
@@ -26,7 +26,8 @@ function stringifyDocContent(node: RenderableTreeNode): string {
2626
2727export const dynamicParams = false ;
2828
29- export default async function Docs ( { params } : DocsProps ) {
29+ export default async function Docs ( props : DocsProps ) {
30+ const params = await props . params ;
3031 const { slug : slugPath } = params ;
3132
3233 const slug = slugPath . join ( '/' ) ;
@@ -93,10 +94,8 @@ export async function generateStaticParams() {
9394 } ) ) ;
9495}
9596
96- export async function generateMetadata (
97- { params } : DocsProps ,
98- parent : ResolvingMetadata
99- ) : Promise < Metadata > {
97+ export async function generateMetadata ( props : DocsProps , parent : ResolvingMetadata ) : Promise < Metadata > {
98+ const params = await props . params ;
10099 const slugPath = params . slug ;
101100 const slug = slugPath . join ( '/' ) ;
102101
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ import { GitHubOutlineIcon } from '../../../../components/icons/github-outline-i
99import { MarkdocRenderer } from '../../../../components/markdoc-renderer' ;
1010import { CloudImage } from '../../../../components/cloud-image' ;
1111
12- export default async function Docs ( { params } : { params : { slug : string } } ) {
12+ export default async function Docs ( props : { params : Promise < { slug : string } > } ) {
13+ const params = await props . params ;
1314 const { slug } = params ;
1415 const project = await reader ( ) . collections . projects . read ( slug ) ;
1516 if ( ! project ) notFound ( ) ;
@@ -136,10 +137,8 @@ export async function generateStaticParams() {
136137
137138export const dynamicParams = false ;
138139
139- export async function generateMetadata (
140- { params } : { params : { slug : string } } ,
141- parent : ResolvingMetadata
142- ) : Promise < Metadata > {
140+ export async function generateMetadata ( props : { params : Promise < { slug : string } > } , parent : ResolvingMetadata ) : Promise < Metadata > {
141+ const params = await props . params ;
143142 const slug = params . slug ;
144143 const project = await reader ( ) . collections . projects . read ( slug ) ;
145144
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export async function POST(req: Request): Promise<Response> {
1212 }
1313
1414 try {
15- const referer = headers ( ) . get ( 'referer' ) ;
15+ const referer = ( await headers ( ) ) . get ( 'referer' ) ;
1616 let pathname = '/' ;
1717 if ( referer ) {
1818 try {
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ export async function generateStaticParams() {
88
99export const dynamicParams = false ;
1010
11- export async function GET ( _ : Request , props : { params : { slug : string [ ] } } ) {
11+ export async function GET ( _ : Request , props : { params : Promise < { slug : string [ ] } > } ) {
1212 const post = await reader ( ) . collections . blog . readOrThrow (
13- props . params . slug . join ( '/' )
13+ ( await props . params ) . slug . join ( '/' )
1414 ) ;
1515 return renderOgImage ( post . title ) ;
1616}
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ export async function generateStaticParams() {
88
99export const dynamicParams = false ;
1010
11- export async function GET ( _ : Request , props : { params : { slug : string [ ] } } ) {
11+ export async function GET ( _ : Request , props : { params : Promise < { slug : string [ ] } > } ) {
1212 const post = await reader ( ) . collections . pages . readOrThrow (
13- props . params . slug . join ( '/' )
13+ ( await props . params ) . slug . join ( '/' )
1414 ) ;
1515 return renderOgImage ( post . title ) ;
1616}
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ export async function generateStaticParams() {
1313
1414export const dynamicParams = false ;
1515
16- export async function GET ( _ : Request , props : { params : { slug : string } } ) {
17- if ( ! pages [ props . params . slug ] ) {
16+ export async function GET ( _ : Request , props : { params : Promise < { slug : string } > } ) {
17+ if ( ! pages [ ( await props . params ) . slug ] ) {
1818 return new Response ( 'Not Found' , { status : 404 } ) ;
1919 }
20- return renderOgImage ( pages [ props . params . slug ] ) ;
20+ return renderOgImage ( pages [ ( await props . params ) . slug ] ) ;
2121}
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ export async function generateStaticParams() {
88
99export const dynamicParams = false ;
1010
11- export async function GET ( _ : Request , props : { params : { slug : string [ ] } } ) {
11+ export async function GET ( _ : Request , props : { params : Promise < { slug : string [ ] } > } ) {
1212 const post = await reader ( ) . collections . projects . readOrThrow (
13- props . params . slug . join ( '/' )
13+ ( await props . params ) . slug . join ( '/' )
1414 ) ;
1515 return renderOgImage ( post . title ) ;
1616}
You can’t perform that action at this time.
0 commit comments