Skip to content

Commit

Permalink
fix: page title for shorts
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 18, 2023
1 parent 0183061 commit 170975f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/site/[site]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ export async function generateMetadata({
queryClient,
)

const title = `${page?.metadata?.content?.title} - ${
site?.metadata?.content?.name || site?.handle
}`
const title = `${
page?.metadata?.content?.title || page?.metadata?.content?.content
} - ${site?.metadata?.content?.name || site?.handle}`

const description = page?.metadata?.content?.summary

const siteImages =
site?.metadata?.content?.avatars?.[0] || `${SITE_URL}/assets/logo.svg`
const images = toGateway(page?.metadata?.content?.cover || siteImages)
const images = page?.metadata?.content?.images
? page?.metadata?.content?.images.map((image) => toGateway(image))
: [siteImages]
const useLargeOGImage = !!page?.metadata?.content?.cover
const twitterCreator = site?.metadata?.content?.connected_accounts
?.find((account) => account?.endsWith?.("@twitter"))
Expand Down

0 comments on commit 170975f

Please sign in to comment.