Star
1.1K

Route Rules

Learn how to use route rules to customise your OG Image.
Nuxt SEO Pro
  • Nuxt Redirects
  • Nuxt Google Search Console
  • Nuxt Internal Links
  • Nuxt SEO Analyze
Save $170 on the presale now.

In some cases, you'll want to apply OG Image setting for a subset of pages.

You can handle this even easier with the route rule merging.

This lets you provide a ogImage key that will be either used or merged into the existing OG Image options.

For example, this documentation website uses it to set the icon depending on your path.

nuxt.config.ts
export default defineNuxtConfig({
  routeRules: {
    '/og-image/**': {
      ogImage: {
        props: { icon: 'carbon:image-search' }
      }
    }
  }
})
Did this page help you?