From d38505f6fa13a94549d127e51c8acb55b75922f5 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 25 Jan 2026 15:03:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20robots.txt?= =?UTF-8?q?=E3=80=81base.tsx=20=E5=92=8C=20sitemap.xml=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=BC=B7=20SEO=20=E8=A8=AD=E5=AE=9A=E8=88=87=E5=A4=9A=E8=AA=9E?= =?UTF-8?q?=E8=A8=80=E6=94=AF=E6=8F=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/robots.txt | 14 +++++++++++++- public/sitemap.xml | 31 +++++++++++++++++++++++++++++++ src/components/base.tsx | 37 +++++++++++++++++++++++++++++++++++-- src/i18n/index.ts | 2 +- 4 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 public/sitemap.xml diff --git a/public/robots.txt b/public/robots.txt index c2aab7e..b733401 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,2 +1,14 @@ +# ConvertX-CN robots.txt +# 允許所有搜尋引擎爬蟲抓取網站內容 + User-agent: * -Disallow: / \ No newline at end of file +Allow: / + +# 禁止抓取的路徑(API 端點與內部資源) +Disallow: /api/ +Disallow: /data/ +Disallow: /uploads/ +Disallow: /output/ + +# Sitemap 位置 +Sitemap: https://convertx-cn.bioailab.qzz.io/sitemap.xml \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..7ca3fc9 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,31 @@ + + + + + + https://convertx-cn.bioailab.qzz.io/ + 2026-01-25 + weekly + 1.0 + + + + + + + https://convertx-cn.bioailab.qzz.io/login + 2026-01-25 + monthly + 0.8 + + + + + https://convertx-cn.bioailab.qzz.io/register + 2026-01-25 + monthly + 0.7 + + + diff --git a/src/components/base.tsx b/src/components/base.tsx index 60a8a57..a536b00 100644 --- a/src/components/base.tsx +++ b/src/components/base.tsx @@ -3,7 +3,7 @@ import { type SupportedLocale, defaultLocale, getTranslations } from "../i18n/in export const BaseHtml = ({ children, - title = "ConvertX-CN", + title = "ConvertX-CN - 免費線上檔案轉換工具 | 支援 PDF、Word、圖片等格式轉換", webroot = "", locale = defaultLocale, }: { @@ -16,13 +16,46 @@ export const BaseHtml = ({ + + {/* SEO 核心設定 - 允許搜尋引擎索引 */} + + + + + + {/* Canonical URL */} + + + {/* 多語言替代連結 */} + + + + {/* 應用程式資訊 */} - + + {/* SEO 描述與關鍵字 */} + + + + + {/* Open Graph / 社交媒體分享 */} + + + + + + + + {/* Twitter Card */} + + + + {title} diff --git a/src/i18n/index.ts b/src/i18n/index.ts index ed0642d..52f15d3 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -228,7 +228,7 @@ export const supportedLocales: LocaleConfig[] = [ ]; // Default to zh-TW, fallback to en -export const defaultLocale: SupportedLocale = "zh-TW"; +export const defaultLocale: SupportedLocale = "zh-CN"; export const fallbackLocale: SupportedLocale = "en"; // Type definitions for translation keys