Setup

Integrations

Install

yarn
yarn add -D @unhead/schema-org
npm
npm install -D @unhead/schema-org
pnpm
pnpm add -D @unhead/schema-org

Setup Plugin

1. Add Plugin to Unhead

Add the plugin to your unhead instance.

import { SchemaOrgUnheadPlugin } from '@unhead/schema-org'createHead({  plugins: [    SchemaOrgUnheadPlugin()  ]})

2. Configure the plugin

To server-side render Schema.org, you'll need to provide a canonical host.

import { SchemaOrgUnheadPlugin } from '@unhead/schema-org'createHead({  plugins: [    SchemaOrgUnheadPlugin({      host: 'https://example.com',    })  ]})

See the User Config page for all options you can pass on schemaOrg.

3. Add Site Schema.org

useSchemaOrg([  // @todo Select Identity: https://unhead-schema-org.harlanzw.com//guide/guides/identity  defineWebSite({    name: 'My Awesome Website',  }),  defineWebPage(),])

Next Steps

Your Nuxt app is now serving basic Schema.org, congrats! 🎉

The next steps are:

  1. Choose an Identity
  2. Set up your pages for Runtime Inferences
  3. Then feel free to follow some recipes: