diff --git a/pages/api/social-image.tsx b/pages/api/social-image.tsx index 3d27619..673d282 100644 --- a/pages/api/social-image.tsx +++ b/pages/api/social-image.tsx @@ -75,12 +75,21 @@ export default withOGImage<'query', 'id'>({ // getPageProperty('Description', block, recordMap) || // config.description - const timePublished = getPageProperty( + const lastUpdatedTime = getPageProperty( + 'Last Updated', + block, + recordMap + ) + const publishedTime = getPageProperty( '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', {