SEO Route Rules

Utilise route rules for dynamic SEO meta tags.

Providing SEO meta tags for dynamic pages at build time can be difficult.

To make this easier, you can leverage the power of Route Rules to provide dynamic SEO meta tags for your pages.

API

seoMeta

This is the same as the useSeoMeta input. Check the docs for more details.

export default defineNuxtConfig({
  routeRules: {
    '/blog/**': {
      seoMeta: {
        ogImage: 'https://example.com'
      },
    },
  }
})

This is the same as the useHead input. Check the docs for more details.

export default defineNuxtConfig({
  routeRules: {
    '/blog/**': {
      head: {
        link: [
          { rel: 'icon', type: 'image/png', href: '/blog-icon.png' }
        ]
      },
    },
  }
})
Did this page help you?