From 2c8d1a306219914912fecbbf1ff158f29b09d230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=8F=E7=8E=84=28=E6=B2=88=E6=89=AC=E5=87=AF=29?= Date: Fri, 16 Jan 2026 11:43:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=80=E6=9C=89=E5=86=85=E9=83=A8?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=94=AF=E6=8C=81=E5=8A=A8=E6=80=81=20BASE?= =?UTF-8?q?=5FPATH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 getUrl 工具函数处理 BASE_URL 前缀 - 修复 Header 导航链接 - 修复 BackButton 返回按钮链接 - 修复 Breadcrumb 面包屑链接 - 修复 404 页面返回首页链接 - 修复 Layout 中的 favicon 和 sitemap 链接 - 修复 index 页面的所有内部链接 Co-Authored-By: Claude Opus 4.5 --- src/components/BackButton.astro | 3 ++- src/components/Breadcrumb.astro | 6 ++++-- src/components/Header.astro | 16 ++++++++++------ src/layouts/Layout.astro | 5 +++-- src/pages/404.astro | 3 ++- src/pages/index.astro | 9 +++++---- src/utils/getUrl.ts | 19 +++++++++++++++++++ 7 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 src/utils/getUrl.ts diff --git a/src/components/BackButton.astro b/src/components/BackButton.astro index 4cbc16eb..b0af1594 100644 --- a/src/components/BackButton.astro +++ b/src/components/BackButton.astro @@ -2,6 +2,7 @@ import IconChevronLeft from "@/assets/icons/IconChevronLeft.svg"; import LinkButton from "./LinkButton.astro"; import { SITE } from "@/config"; +import { getUrl } from "@/utils/getUrl"; --- { @@ -9,7 +10,7 @@ import { SITE } from "@/config";
diff --git a/src/components/Breadcrumb.astro b/src/components/Breadcrumb.astro index 0f806895..ede55c56 100644 --- a/src/components/Breadcrumb.astro +++ b/src/components/Breadcrumb.astro @@ -36,6 +36,8 @@ if (breadcrumbList[0] === "tags" && !isNaN(Number(breadcrumbList[2]))) { function getDisplayName(path: string): string { return pathNameMap[path] || path; } + +import { getUrl } from "@/utils/getUrl"; ---