Skip to content

Commit

Permalink
🥖
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Apr 8, 2022
1 parent 67b5a8d commit 40fc827
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pages/api/social-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,21 @@ export default withOGImage<'query', 'id'>({
// getPageProperty<string>('Description', block, recordMap) ||
// config.description

const timePublished = getPageProperty<number>(
const lastUpdatedTime = getPageProperty<number>(
'Last Updated',
block,
recordMap
)
const publishedTime = getPageProperty<number>(
'Published',
block,
recordMap
)
const dateUpdated = timePublished ? new Date(timePublished) : undefined
const dateUpdated = lastUpdatedTime
? new Date(lastUpdatedTime)
: publishedTime
? new Date(publishedTime)
: undefined
const date =
isBlogPost && dateUpdated
? `${dateUpdated.toLocaleString('en-US', {
Expand Down

0 comments on commit 40fc827

Please sign in to comment.