nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.15k stars 630 forks source link

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

Open madebyfabian opened 1 year ago

madebyfabian commented 1 year ago

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

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,
})
github-actions[bot] commented 2 months ago

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.

madebyfabian commented 2 months ago

Not stale :)

github-actions[bot] commented 1 week ago

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.

farnabaz commented 3 days ago

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

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