nextjs-seo-booster · diff
git:20260116.d3a8dc0 to v1.1
23 added, 28 removed. Audit A to A.
---
name: nextjs-seo-booster
description: A complete SEO toolkit for Next.js applications, including structured data (Schema.org), dynamic sitemap generation, and meta tags.
+ version: 1.1
---
- # Next.js SEO Booster
-
- This skill helps you instantly add professional-grade SEO capabilities to a Next.js (App Router) project.
+ # Next.js SEO Booster Protocol
- ## Components Included
- 1. **StructuredData.tsx**: Injects Google-compliant JSON-LD schema (WebSite, Organization, SoftwareApplication).
- 2. **sitemap.ts**: Dynamically generates `sitemap.xml` for all your routes, including programmatic SEO pages.
+ **Role**: Full-Stack SEO Toolkit
+ **Core Function**: 提供开箱即用的 SEO 组件代码,加速开发流程。
- ## Usage Instructions
+ ## When This Skill Applies
+ * 当用户需要 **JSON-LD Schema** 代码实现时。
+ * 当用户需要生成 **Dynamic Sitemap** 代码时。
+ * 当 `nextjs-seo-foundations` 确定了标准,需要具体组件落地时。
- ### 1. Structured Data (JSON-LD)
- Copy `resources/StructuredData.tsx` to your `components/` directory.
- Import and use it in your root layout (`app/layout.tsx`):
+ ## Instructions
- ```tsx
- import StructuredData from '@/components/StructuredData';
+ 本 Skill 提供了即插即用的代码组件。
- export default function RootLayout({ children }) {
- return (
- <html>
- <head>
- <StructuredData />
- </head>
- <body>{children}</body>
- </html>
- );
- }
+ ### Prerequisites
+ 使用此 Skill 前必须安装 Type Definitions:
+ ```bash
+ npm install -D schema-dts
```
- ### 2. Sitemap Generation
- Copy `resources/sitemap.ts` to your `app/` directory.
- Modify the `const routes` array to match your website's pages.
+ ### 1. Structured Data Component
+ * **Source**: `resources/StructuredData.tsx`
+ * **Usage**: 这是一个通用的 Schema 注入组件。它不再依赖项目特定的配置,而是通过 Props 或环境变量工作。
- ### 3. Verification
- - Visit `http://localhost:3000/sitemap.xml` to see your sitemap.
- - Use Google's Rich Results Test to validate the structured data.
+ ### 2. Sitemap Generator
+ * **Source**: `resources/sitemap.ts`
+ * **Usage**: 复制到 `app/sitemap.ts` 并配置路由列表。
+
+ ## Actions
+ * 使用 `copy-item` 将资源文件复制到项目 `components/` 目录。