Skip to content

Commit b157500

Browse files
committed
fix(useContentHead): undefined url
1 parent 8e7733a commit b157500

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/composables/head.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const useContentHead = (
8888
head.meta.push({
8989
property: 'og:image',
9090
// @ts-ignore - We expect `head.image` from Nuxt configurations...
91-
content: host && !hasProtocol(image) ? new URL(joinURL(config.app.baseURL, image), url).href : image
91+
content: host && !hasProtocol(image) ? new URL(joinURL(config.app.baseURL, image), host).href : image
9292
})
9393
}
9494

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

0 commit comments

Comments
 (0)