You can configure the Nuxt AEO module options in nuxt.config.ts.
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
// Module options
},
})
schemasAn array of schemas to inject globally. Configured schemas are automatically injected into all pages.
Type: GlobalSchema[]:brDefault: undefined
Description:
schemas array is missing or empty, a default Project schema is injectedcontext and type will automatically convert them to @context and @type internallyurl field
url is not specified, the schema is applied to all routes (backward compatibility)url is specified, the schema is only applied when the current route path matches exactly/, /introduction) and absolute URLs (https://www.example.com/about) are supportedNote: If the
schemasarray is missing or empty, a defaultProjectschema is automatically injected.
Example:
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
schemas: [
{
type: 'Organization',
name: 'My Company',
url: '/', // Relative URL - will be normalized to absolute
logo: '/images/logo.png', // Relative URL - will be normalized to absolute
},
{
type: 'Person',
name: 'Yeonju Lee',
alternateName: 'Dewdew',
jobTitle: 'Software Engineer / CDO',
url: 'https://www.example.com', // Absolute URL - used as-is
image: '/images/profile.jpg', // Relative URL - will be normalized to absolute
knowsAbout: ['Nuxt3', 'TypeScript', 'Supabase'],
sameAs: [
'https://github.com/dewdew', // Absolute URL - used as-is
'/social/twitter', // Relative URL - will be normalized to absolute
],
},
{
type: 'WebSite',
name: 'My Website',
url: 'https://www.example.com', // Absolute URL - used as-is
description: 'My awesome website',
},
],
},
})
Route-Specific Schema Example:
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
schemas: [
{
type: 'WebSite',
name: 'Portfolio',
description: 'Portfolio is a website of Software Engineer.',
url: '/', // Only applied to root route (/)
logo: '/images/logo.png',
},
{
type: 'Introduction',
name: 'Introduction',
description: 'Introduction is a page of Software Engineer.',
url: '/introduction', // Only applied to /introduction route
logo: '/images/logo.png',
},
{
type: 'Organization',
name: 'My Company',
// No url field - applied to all routes (backward compatibility)
},
],
},
})
autoInjectControls whether global schema information is automatically injected.
Type: boolean:brDefault: true
Description:
true: Schemas configured in the schemas array are automatically injected into all pagesfalse: Even if the schemas array exists, schemas are not injectedschemas array is missing, a default Project schema is injected (except when autoInject: false)Example:
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
schemas: [
{
type: 'Organization',
name: 'My Company',
},
],
autoInject: false, // Disable automatic global schema injection
},
})
renderHtmlControls whether semantic HTML is automatically generated globally.
Type: boolean:brDefault: true
Description:
true: Semantic HTML is automatically generated for global schemas and injected into pagesrenderHtml option on individual schemasExample:
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
schemas: [
{
type: 'Organization',
name: 'My Company',
renderHtml: true, // Can be overridden on individual schemas
},
],
renderHtml: true, // Global default value
},
})
visuallyHiddenControls whether semantic HTML is visually hidden globally.
Type: boolean:brDefault: true
Description:
true: Generated semantic HTML is hidden with the visually-hidden classvisuallyHidden option on individual schemasExample:
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
schemas: [
{
type: 'Organization',
name: 'My Company',
visuallyHidden: false, // Can be overridden on individual schemas
},
],
visuallyHidden: true, // Global default value
},
})
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
// Global schema array
schemas: [
{
type: 'Organization',
name: 'My Company',
url: '/', // Relative URL - will be normalized to absolute
logo: '/images/logo.png', // Relative URL - will be normalized to absolute
renderHtml: true,
visuallyHidden: true,
},
{
type: 'Person',
name: 'Yeonju Lee',
alternateName: 'Dewdew',
jobTitle: 'Software Engineer / CDO',
url: 'https://www.example.com', // Absolute URL - used as-is
image: '/images/profile.jpg', // Relative URL - will be normalized to absolute
knowsAbout: ['Nuxt3', 'TypeScript', 'Supabase'],
sameAs: [
'https://github.com/dewdew', // Absolute URL - used as-is
'/social/twitter', // Relative URL - will be normalized to absolute
],
renderHtml: true,
visuallyHidden: true,
},
{
type: 'WebSite',
name: 'My Website',
url: 'https://www.example.com', // Absolute URL - used as-is
description: 'My awesome website',
},
],
// Automatic injection
autoInject: true,
// Global semantic HTML auto-generation
renderHtml: true,
// Global visual hiding
visuallyHidden: true,
},
})
This page includes FAQPage Schema to help AI models and search engines understand common questions about module options configuration.
<script setup lang="ts">
useSchemaFaq({
mainEntity: [
{
name: 'Is global schema configuration required?',
acceptedAnswer: {
text: 'No, it is not required. If the schemas array is missing or empty, a default Project Schema will be automatically injected. However, if you configure schemas like Organization, Person, or WebSite globally, they will be automatically applied to all pages.',
},
},
{
name: 'What is the autoInject option?',
acceptedAnswer: {
text: 'The autoInject option controls whether global schema information is automatically injected. If true (default), schemas configured in the schemas array are automatically injected into all pages. If set to false, they will not be injected.',
},
},
{
name: 'What is the difference between renderHtml and visuallyHidden?',
acceptedAnswer: {
text: 'renderHtml controls whether semantic HTML is automatically generated, while visuallyHidden controls whether the generated HTML is visually hidden. If renderHtml is true, semantic HTML is generated along with JSON-LD. If visuallyHidden is true (default), it is not visible to users but can be read by LLM crawlers.',
},
},
{
name: 'Can I override options on individual schemas?',
acceptedAnswer: {
text: 'Yes, the renderHtml and visuallyHidden options can be set not only globally but also on individual schemas, allowing you to specify different behavior for specific schemas.',
},
},
{
name: 'How do route-specific schemas work?',
acceptedAnswer: {
text: 'You can configure schemas to be applied only to specific routes by setting the url field in the schema configuration. If url is not specified, the schema is applied to all routes (backward compatibility). If url is specified, the schema is only applied when the current route path matches exactly. Both relative paths and absolute URLs are supported.',
},
},
],
})
</script>