From ab58d2e25189d28978d84bee8fb295beb20a3fa7 Mon Sep 17 00:00:00 2001 From: Rhen Cloud Date: Fri, 16 Jan 2026 14:22:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20@nuxtjs/robots=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=A5=E6=94=AF=E6=8C=81=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bun.lock | 1 + nuxt.config.ts | 16 +++++++++++++++- package.json | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) 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",