AgentSkillsCN

nuxt-seo

Nuxt SEO 元模块,内置 robots、站点地图、OG 图像、schema-org。当您需要配置 SEO、生成站点地图、创建 OG 图像,或添加结构化数据时,可使用此技能。

SKILL.md
--- frontmatter
name: nuxt-seo
description: Nuxt SEO meta-module with robots, sitemap, og-image, schema-org. Use when configuring SEO, generating sitemaps, creating OG images, or adding structured data.
license: MIT

Nuxt SEO

bash
npx nuxi module add @nuxtjs/seo

When to Use

Working with:

  • SEO configuration (site URL, name, indexability)
  • Robots.txt and sitemap.xml generation
  • Dynamic OG image generation
  • JSON-LD structured data (schema.org)
  • Breadcrumbs and canonical URLs

Usage Pattern

Progressive loading - only read what you need:

Site Config

Foundation for all SEO modules. Configure site in nuxt.config.ts, access via useSiteConfig(). See references/site-config.md for full options.

Module Overview

ModulePurposeKey API
nuxt-site-configShared configuseSiteConfig()
@nuxtjs/robotsrobots.txtuseRobotsRule()
@nuxtjs/sitemapsitemap.xmldefineSitemapEventHandler()
nuxt-og-imageOG imagesdefineOgImage()
nuxt-schema-orgJSON-LDuseSchemaOrg()
nuxt-seo-utilsMeta utilitiesuseBreadcrumbItems()
nuxt-link-checkerLink validationBuild-time checks

Nuxt Content v3

Use asSeoCollection() for automatic sitemap, og-image, and schema-org from frontmatter:

ts
// content.config.ts
import { defineCollection, defineContentConfig } from '@nuxt/content'
import { asSeoCollection } from '@nuxtjs/seo/content'

export default defineContentConfig({
  collections: {
    posts: defineCollection(asSeoCollection({ type: 'page', source: 'posts/**' }))
  }
})

Important: Load @nuxtjs/seo before @nuxt/content in modules array:

ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/seo', '@nuxt/content']
})

Frontmatter fields: ogImage, sitemap, robots, schemaOrg.

Related Skills

Links

Token Efficiency

Main skill: ~250 tokens. Each sub-file: ~400-600 tokens. Only load files relevant to current task.