File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export async function generateMetadata({
1212} ) : Promise < Metadata > {
1313 const { id } = await params
1414 const posts = ( await getAllPostMeta ( ) ) . filter ( ( p ) => p . author . id === id )
15- return buildAuthorMetadata ( posts [ 0 ] ?. author )
15+ return buildAuthorMetadata ( id , posts [ 0 ] ?. author )
1616}
1717
1818export default async function AuthorPage ( { params } : { params : Promise < { id : string } > } ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export async function generateMetadata({
1212} ) : Promise < Metadata > {
1313 const { id } = await params
1414 const posts = ( await getAllPostMeta ( ) ) . filter ( ( p ) => p . author . id === id )
15- return buildAuthorMetadata ( posts [ 0 ] ?. author )
15+ return buildAuthorMetadata ( id , posts [ 0 ] ?. author )
1616}
1717
1818export default async function AuthorPage ( { params } : { params : Promise < { id : string } > } ) {
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ export function buildTagsBreadcrumbJsonLd() {
4141 return buildTagsBreadcrumbJsonLdGeneric ( BLOG_SECTION )
4242}
4343
44- export function buildAuthorMetadata ( author ?: Author ) {
45- return buildAuthorMetadataGeneric ( BLOG_SECTION , author )
44+ export function buildAuthorMetadata ( id : string , author ?: Author ) {
45+ return buildAuthorMetadataGeneric ( BLOG_SECTION , id , author )
4646}
4747
4848export function buildAuthorGraphJsonLd ( author : Author ) {
Original file line number Diff line number Diff line change @@ -270,9 +270,13 @@ export function buildTagsBreadcrumbJsonLd(section: ContentSection) {
270270 }
271271}
272272
273- export function buildAuthorMetadata ( section : ContentSection , author ?: Author ) : Metadata {
273+ export function buildAuthorMetadata (
274+ section : ContentSection ,
275+ id : string ,
276+ author ?: Author
277+ ) : Metadata {
274278 const name = author ?. name ?? 'Author'
275- const canonical = `${ SITE_URL } ${ section . basePath } /authors/${ author ?. id ?? '' } `
279+ const canonical = `${ SITE_URL } ${ section . basePath } /authors/${ id } `
276280 const description = `Read articles by ${ name } on the Sim ${ section . name . toLowerCase ( ) } .`
277281 return {
278282 title : `${ name } | Sim ${ section . name } ` ,
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ export function buildTagsBreadcrumbJsonLd() {
4242 return buildTagsBreadcrumbJsonLdGeneric ( LIBRARY_SECTION )
4343}
4444
45- export function buildAuthorMetadata ( author ?: Author ) {
46- return buildAuthorMetadataGeneric ( LIBRARY_SECTION , author )
45+ export function buildAuthorMetadata ( id : string , author ?: Author ) {
46+ return buildAuthorMetadataGeneric ( LIBRARY_SECTION , id , author )
4747}
4848
4949export function buildAuthorGraphJsonLd ( author : Author ) {
You can’t perform that action at this time.
0 commit comments