diff --git a/.gitignore b/.gitignore index fa3917e..dca985d 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,5 @@ yarn-error.log* next-env.d.ts # next-sitemap -robots.txt sitemap.xml sitemap-*.xml diff --git a/next-sitemap.config.js b/next-sitemap.config.js deleted file mode 100644 index 5dc06e6..0000000 --- a/next-sitemap.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @type {import('next-sitemap').IConfig} - * @see https://github.com/iamvishnusankar/next-sitemap#readme - */ -module.exports = { - // !STARTERCONF Change the siteUrl - /** Without additional '/' on the end, e.g. https://theodorusclarence.com */ - siteUrl: 'https://tsnext-tw.thcl.dev', - generateRobotsTxt: true, - robotsTxtOptions: { - policies: [{ userAgent: '*', allow: '/' }], - }, -}; diff --git a/package.json b/package.json index 14c0ab6..e35cf07 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,9 @@ "format": "prettier -w .", "format:check": "prettier -c .", "gen:runtime": "node scripts/convert-config.js", - "postbuild": "next-sitemap --config next-sitemap.config.js", + "postbuild": "echo 'Build completed - sitemap generation disabled'", "prepare": "husky install", - "pages:build": "pnpm gen:runtime && next build && next-sitemap --config next-sitemap.config.js && npx @cloudflare/next-on-pages --experimental-minify" + "pages:build": "pnpm gen:runtime && next build && npx @cloudflare/next-on-pages --experimental-minify" }, "dependencies": { "@cloudflare/next-on-pages": "^1.13.12", @@ -65,7 +65,6 @@ "jest": "^27.5.1", "lint-staged": "^12.5.0", "next-router-mock": "^0.9.0", - "next-sitemap": "^2.5.28", "postcss": "^8.5.1", "prettier": "^2.8.8", "prettier-plugin-tailwindcss": "^0.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 78c31b2..9e0ff3f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -138,9 +138,6 @@ importers: next-router-mock: specifier: ^0.9.0 version: 0.9.13(next@14.2.30(@babel/core@7.27.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) - next-sitemap: - specifier: ^2.5.28 - version: 2.5.28(next@14.2.30(@babel/core@7.27.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) postcss: specifier: ^8.5.1 version: 8.5.6 @@ -950,9 +947,6 @@ packages: resolution: {integrity: sha512-7/z7pA7BM0i8XvMSBynO7xsB3mVQPUZbVn6zMIlp/a091XJ3qAXRXc+HwLYhiIdzzS5fuxxNIHZMGHVD4HJxdA==} engines: {node: '>=v12'} - '@corex/deepmerge@2.6.148': - resolution: {integrity: sha512-6QMz0/2h5C3ua51iAnXMPWFbb1QOU1UvSM4bKBw5mzdT+WtLgjbETBBIQZ+Sh9WvEcGwlAt/DEdRpIC3XlDBMA==} - '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -4704,13 +4698,6 @@ packages: next: '>=10.0.0' react: '>=17.0.0' - next-sitemap@2.5.28: - resolution: {integrity: sha512-rDMTa7nLE0ikYnu8JDCrwQufIRm4b4Sg8BK11DGdDAmYpXmcmw4Qvm+oVBR8gUL97E6i2ihTM+cRx8mgENDACA==} - engines: {node: '>=14.18'} - hasBin: true - peerDependencies: - next: '*' - next-themes@0.4.6: resolution: {integrity: sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==} peerDependencies: @@ -7315,8 +7302,6 @@ snapshots: dependencies: chalk: 4.1.2 - '@corex/deepmerge@2.6.148': {} - '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -11578,12 +11563,6 @@ snapshots: next: 14.2.30(@babel/core@7.27.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 - next-sitemap@2.5.28(next@14.2.30(@babel/core@7.27.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): - dependencies: - '@corex/deepmerge': 2.6.148 - minimist: 1.2.8 - next: 14.2.30(@babel/core@7.27.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - next-themes@0.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..289efab --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# 禁止所有搜索引擎爬取 +User-agent: * +Disallow: /