Nuxt Content
Nuxt OG Image integrates with Nuxt Content out of the box.
It supports the
This will only work when you're using Document Driven mode, or you have set a
Setup
Add the
---
ogImage:
component: BlogOgImage
props:
image: /blog/3-months-of-europe.png
readingMins: 5
---
If you're not using Document Driven mode, you must use the
---
path: /blog/3-months-of-europe
ogImage:
component: BlogOgImage
props:
image: /blog/3-months-of-europe.png
readingMins: 5
---
If you're not using
export default defineNuxtConfig({
ogImage: {
strictNuxtContentPaths: true
}
})
Additionally, you will need to make sure you're using the
<script setup>
const page = await useAsyncData(`docs-${route.path}`, () => queryContent(route.path).findOne())
useContentHead(page)
</script>
If you have issues with your
Using Components
If you'd like to use the
export default defineNuxtConfig({
ogImage: {
componentOptions: {
global: true,
}
}
})
:OgImage{component="BlogOgImage" image="/blog/3-months-of-europe.png" readingMins="5"}