Skip to content

Commit

Permalink
fix(useContentHead): undefined url
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jan 26, 2023
1 parent 8e7733a commit b157500
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/composables/head.ts
Expand Up @@ -88,7 +88,7 @@ export const useContentHead = (
head.meta.push({
property: 'og:image',
// @ts-ignore - We expect `head.image` from Nuxt configurations...
content: host && !hasProtocol(image) ? new URL(joinURL(config.app.baseURL, image), url).href : image
content: host && !hasProtocol(image) ? new URL(joinURL(config.app.baseURL, image), host).href : image
})
}

Expand All @@ -112,7 +112,7 @@ export const useContentHead = (
const imageURL = isAbsoluteURL ? image.src : joinURL(config.app.baseURL, image.src ?? '/')
head.meta.push({
property: 'og:image',
content: host && !isAbsoluteURL ? new URL(imageURL, url).href : imageURL
content: host && !isAbsoluteURL ? new URL(imageURL, host).href : imageURL
})
} else if (image[key]) {
head.meta.push({
Expand Down

0 comments on commit b157500

Please sign in to comment.