content icon indicating copy to clipboard operation
content copied to clipboard

`useContentHead` should add `og:image` including base url.

Open madebyfabian opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe

Currently, useContentHead just adds the relative path to the image as the og:image. This is invalid though. See

  • https://github.com/jitsi/jitsi-meet/issues/6031

Describe the solution you'd like

Either use some globally defined option defined in the nuxt.config.ts (preferred one), or add it as an option to define the base url when using useContentHead.

Describe alternatives you've considered

useContentHead(page.value)

useSeoMeta({
  ogImage: page.value.image?.src ? joinURL(runtimeConfig.public.siteUrl, page.value.image.src) : undefined,
})

madebyfabian avatar Oct 14 '23 10:10 madebyfabian

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 23 '24 02:09 github-actions[bot]

Not stale :)

madebyfabian avatar Sep 23 '24 07:09 madebyfabian

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Nov 23 '24 02:11 github-actions[bot]

Could you try adding content.documentDriven.host in nuxt.config.ts?

export default defineNuxtConfig({
  content: {
    documentDriven: {
      host: 'website-url'
    }
  }
})

farnabaz avatar Nov 28 '24 10:11 farnabaz

@farnabaz Hi there, thanks for the suggestion. This indeed helps :) https://stackblitz.com/edit/github-igeqmqns?file=content%2Findex.md,nuxt.config.ts

But I am wondering – do I enable the document driven mode when using this config? And shouldn't this be a default with our without the document driven mode, given the state that without a host, the og image meta tag is basically invalid. Haven't checked out yet if that's solved in the new v3 alpha though.

madebyfabian avatar Dec 21 '24 21:12 madebyfabian