feat: enhance post detail metadata with tweet title or text
This commit is contained in:
parent
be855563bb
commit
6542db8c92
1 changed files with 5 additions and 1 deletions
|
|
@ -13,6 +13,10 @@ type PostDetailResponse = {
|
||||||
url?: string;
|
url?: string;
|
||||||
author?: string;
|
author?: string;
|
||||||
tags?: string[];
|
tags?: string[];
|
||||||
|
tweet: {
|
||||||
|
text?: string;
|
||||||
|
title?: string;
|
||||||
|
};
|
||||||
mediaUrl?: string;
|
mediaUrl?: string;
|
||||||
mediaIndex?: number;
|
mediaIndex?: number;
|
||||||
};
|
};
|
||||||
|
|
@ -118,7 +122,7 @@ export async function generateMetadata({ params }: { params: Promise<{ id: strin
|
||||||
|
|
||||||
const source = getSourceLabel(post.type);
|
const source = getSourceLabel(post.type);
|
||||||
const author = post.author?.trim() || "unknown";
|
const author = post.author?.trim() || "unknown";
|
||||||
const title = `${author} | ${source}`;
|
const title = `${author} - ${post.type == "twitter" ? post.tweet.text : post.tweet.title} | ${source}`;
|
||||||
const description = createDetailDescription(post);
|
const description = createDetailDescription(post);
|
||||||
const ogImages = post.mediaUrl
|
const ogImages = post.mediaUrl
|
||||||
? [
|
? [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue