Skip to content

Commit d567f4b

Browse files
committed
fix title for seo
1 parent 185b8fb commit d567f4b

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎frontend/main/src/models/sponsor.model.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface Sponsor {
1212
//Core Fields
1313
company: string;
1414
slug: string;
15+
title: string;
1516
coverPhoto?: CoverMedia;
1617
coverVideo?: CoverMedia;
1718
description?: string;

‎frontend/main/src/pages/sponsors/[sponsorPath].tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function SponsorPage({
8989
return (
9090
<>
9191
<NextSeo
92-
title={`${sponsor?.company || ''} | CodingCatDev`}
92+
title={`${sponsor?.title || ''} | CodingCatDev`}
9393
canonical={`https://codingcat.dev/sponsors/`}
9494
></NextSeo>
9595
<Layout site={site}>

‎frontend/main/src/services/notion.server.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export const getSponsorBySlugService = async ({
168168
},
169169
});
170170

171-
return formatPosts(raw, 'author');
171+
return formatPosts(raw, 'sponsor');
172172
};
173173

174174
export const getSponsorPageBlocks = async (slug: string) => {
@@ -273,9 +273,13 @@ const formatPost = async (
273273
} - ${q?.properties?.Name?.title
274274
.map((t: any) => t.plain_text)
275275
.join('')}`
276-
: `${q?.properties?.title?.title
276+
: q?.properties?.title?.title
277+
? `${q?.properties?.title?.title
277278
.map((t: any) => t.plain_text)
278-
.join('')}`,
279+
.join('')}`
280+
: `${q?.properties?.Name?.title
281+
.map((t: any) => t.plain_text)
282+
.join('')}` || null,
279283
coverPhoto: {
280284
secure_url: coverPublicId
281285
? `https://media.codingcat.dev/image/upload${coverPublicId}`

0 commit comments

Comments
 (0)