OG Image (Open Graph Image) is the preview image that appears when you share a link on social media platforms (Twitter/X, Facebook, LinkedIn, Slack, etc.) or messaging apps. It's part of the Open Graph Protocol that controls how links are "unfurled" or displayed when shared.
When someone shares a link to your storefront, the platform fetches the page's Open Graph meta tags (including og:image) and displays a preview card with:
og:title)og:description)og:image)Having a well-designed OG image can significantly improve click-through rates when your pages are shared, even if it doesn't directly affect organic search traffic.
Laioutr can use Nuxt OG Image (part of Nuxt SEO) to automatically generate OG images using Vue templates. Unlike robots.txt (which is included by default), OG Image is optional and needs to be added to your project.
Nuxt OG Image generates og:image meta tags and serves the actual images using one of three renderers:
You can:
Images are generated on-demand (when first requested) or at build time (prerendered), and cached for performance.
To enable OG Image generation, add nuxt-og-image to your Nuxt modules:
// nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@laioutr-core/frontend-core',
'nuxt-og-image', // Add this
// ... other modules
],
});
Then install the package:
pnpm add nuxt-og-image
# or
npm install nuxt-og-image
Note: v6 is currently in beta. If you want the latest features, install with nuxt-og-image@beta. See the migration guide for upgrade instructions.
The module works with minimal configuration. You can set defaults in nuxt.config.ts:
// nuxt.config.ts
export default defineNuxtConfig({
ogImage: {
// Your site URL (required for absolute image URLs)
host: 'https://yourstore.com',
// Default renderer (satori, takumi, or browser)
defaults: {
renderer: 'satori',
},
},
});
Nuxt OG Image includes built-in templates you can use:
// In a page or component
defineOgImage({
component: 'NuxtSeo',
title: 'My Product Page',
description: 'Check out this amazing product',
});
You can create custom OG images using Vue components. Create a component in your project:
<!-- components/OgImageProduct.vue -->
<template>
<div class="flex flex-col items-center justify-center w-full h-full bg-gradient-to-br from-blue-500 to-purple-600 text-white p-12">
<h1 class="text-6xl font-bold mb-4">{{ title }}</h1>
<p class="text-2xl">{{ description }}</p>
<div v-if="price" class="mt-8 text-4xl font-bold">
{{ price }}
</div>
</div>
</template>
<script setup lang="ts">
defineProps<{
title: string;
description: string;
price?: string;
}>();
</script>
Then use it in your pages:
// In a page component or PageRenderer
defineOgImage({
component: 'OgImageProduct',
title: product.name,
description: product.description,
price: product.formattedPrice,
});
For a quick setup, you can generate OG images by taking screenshots of your pages:
// nuxt.config.ts
export default defineNuxtConfig({
ogImage: {
defaults: {
renderer: 'browser',
// Screenshot the page
screenshot: true,
// Hide elements you don't want in the OG image
hideElements: ['.header', '.footer', '.cart-button'],
// Wait for animations/loading
waitForSelector: '.product-loaded',
},
},
});
Since Laioutr pages are rendered via PageRenderer, you can set OG images per page. The most common approach is to:
For example, in a product detail page section:
<!-- sections/ProductDetail.vue -->
<script setup lang="ts">
import { defineOgImage } from '#imports';
const props = defineProps<{
product: {
name: string;
description: string;
image: string;
price: string;
};
}>();
// Set OG image for this page
defineOgImage({
component: 'OgImageProduct',
title: props.product.name,
description: props.product.description,
price: props.product.price,
image: props.product.image,
});
</script>
You can combine OG image generation with the page variant's SEO settings (title, description) from Studio:
// In PageRenderer or a page component
const pageVariant = computed(() => props.page.variants[0]);
defineOgImage({
component: 'OgImageDefault',
title: pageVariant.value.seo.title || props.page.type,
description: pageVariant.value.seo.description,
});
Since pages fetch data via Orchestr (products, categories, etc.), you can use that data to generate dynamic OG images:
// After fetching product data via Orchestr
const product = await useOrchestr().executeQuery(ProductBySlugQuery, { slug });
defineOgImage({
component: 'OgImageProduct',
title: product.name,
description: product.description,
image: product.media?.[0]?.sources[0]?.src,
price: product.prices.formattedPrice,
});
You can use different renderers for different pages:
// Simple product card - use Takumi for speed
defineOgImage({
component: 'OgImageProduct',
renderer: 'takumi',
// ...
});
// Complex layout with animations - use Browser
defineOgImage({
component: 'OgImageComplex',
renderer: 'browser',
// ...
});
Nuxt OG Image works on edge runtimes (Vercel Edge, Netlify Edge, Cloudflare Workers) when using Satori or Takumi renderers. Browser renderer requires a Node.js runtime or Cloudflare Browser Rendering.
Use Nuxt DevTools to preview and test your OG images with hot module reload. The OG Image Playground lets you see how images look before deploying.
You can also use the Social Share Debugger to preview how your links appear on different platforms.
og:image meta tags and serves images using Vue templates (Satori, Takumi, or Browser renderer).For detailed configuration options, renderer choices, and advanced usage, see the Nuxt OG Image documentation.
Link Checker
Automatically scan your Laioutr frontend for broken links, SEO issues, and accessibility problems during development and build time. Find and fix link issues before they reach production.
Robots.txt
Control how search engines and crawlers interact with your Laioutr frontend using robots.txt, meta tags, and X-Robots-Tag headers. Configure globally and per-page via Studio.