Skip to content

Commit

Permalink
feat: support fetching from the og:image
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed May 4, 2022
1 parent d37250d commit 29b553e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/schema-org/createSchemaOrg/index.ts
Expand Up @@ -159,6 +159,8 @@ export const createSchemaOrg = (options: CreateSchemaOrgInput) => {
ctx.meta.title = document.title || undefined
if (!ctx.meta.description)
ctx.meta.description = document.querySelector('meta[name="description"]')?.getAttribute('content') || undefined
if (!ctx.meta.image)
ctx.meta.description = document.querySelector('meta[property="og:image"]')?.getAttribute('content') || undefined
// Note: this will trigger the schema to be re-generated if a value changes
})
}
Expand Down

0 comments on commit 29b553e

Please sign in to comment.