diff --git a/bun.lock b/bun.lock index 9c6c34c..1960e4d 100644 --- a/bun.lock +++ b/bun.lock @@ -10,6 +10,7 @@ "@nuxt/icon": "^2.2.0", "@nuxt/image": "2.0.0", "@nuxtjs/icon": "^2.6.0", + "@nuxtjs/robots": "^5.6.7", "@nuxtjs/seo": "3.3.0", "@nuxtjs/sitemap": "^7.5.2", "nodemailer": "^7.0.12", diff --git a/nuxt.config.ts b/nuxt.config.ts index bb49737..839f728 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -5,7 +5,15 @@ import tailwindcss from "@tailwindcss/vite"; export default defineNuxtConfig({ compatibilityDate: "2025-12-12", srcDir: "app", - modules: ["@nuxt/image", "@nuxt/eslint", "@nuxtjs/sitemap", "@nuxt/icon", "@nuxtjs/seo"], + + modules: [ + "@nuxt/image", + "@nuxt/eslint", + "@nuxtjs/robots", + "@nuxtjs/sitemap", + "@nuxt/icon", + "@nuxtjs/seo", + ], // 禁用 Vue Router 的非关键警告 vue: { @@ -39,6 +47,12 @@ export default defineNuxtConfig({ "/friends": { prerender: true }, }, + robots: { groups: [{ userAgent: ["GPTBot", "ChatGPT-User"], disallow: ["/"] }] }, + + sitemap: { + zeroRuntime: true, + }, + app: { head: { charset: "utf-8", diff --git a/package.json b/package.json index 7330424..5bd6054 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@nuxt/icon": "^2.2.0", "@nuxt/image": "2.0.0", "@nuxtjs/icon": "^2.6.0", + "@nuxtjs/robots": "^5.6.7", "@nuxtjs/seo": "3.3.0", "@nuxtjs/sitemap": "^7.5.2", "nodemailer": "^7.0.12",