Skip to content

Commit

Permalink
normalizeTitle social-image
Browse files Browse the repository at this point in the history
  • Loading branch information
hanmilLee committed Apr 9, 2022
1 parent 3eac9a8 commit c9aa2dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/api/social-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getSiteForDomain } from 'lib/get-site-for-domain'
import { mapImageUrl } from 'lib/map-image-url'
import * as config from 'lib/config'
import { interRegular } from 'lib/fonts'
import { normalizeTitle} from '../../lib/get-canonical-page-id'

/**
* Social image generation via headless chrome.
Expand Down Expand Up @@ -47,7 +48,7 @@ export default withOGImage<'query', 'id'>({

const isBlogPost =
block.type === 'page' && block.parent_table === 'collection'
const title = getBlockTitle(block, recordMap) || site.name
const title = normalizeTitle(getBlockTitle(block, recordMap) || site.name)
const image = mapImageUrl(
getPageProperty<string>('Social Image', block, recordMap) ||
(block as PageBlock).format?.page_cover ||
Expand Down

1 comment on commit c9aa2dd

@vercel
Copy link

@vercel vercel bot commented on c9aa2dd Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextjs-notion-starter-kit – ./

nextjs-notion-starter-kit-hanmillee.vercel.app
hmdev.vercel.app
nextjs-notion-starter-kit-git-main-hanmillee.vercel.app

Please sign in to comment.