fix: Header 跨页锚点导航 + 后台移除固定 URL 编辑项

- Header 作品/联系:首页内直接平滑滚动;在 /services、/work/* 等
  非首页时写入 hq:pendingScrollAnchor 后经路由过渡回首页,
  SmoothScroller 消费并滚动到位(修复其它页面点击无反应)
- 服务按钮在 /services 页自身不再重复导航
- PENDING_SCROLL_ANCHOR_SESSION_KEY 收敛到 lib/scrollEnv 单一来源,
  work 页与 SmoothScroller 共用,消除三处魔法字符串
- 后台「关于」组移除 about_p2_link_href(站内结构性锚点 #selected-work
  不可配,只保留链接文字可编辑);seed/settings/类型同步清理
This commit is contained in:
2026-09-02 20:10:05 +08:00
parent a4642f2274
commit 520fbb1480
8 changed files with 33 additions and 14 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ export default async function Home() {
<span className="select-text">
{config.about_p2}
<a
href={config.about_p2_link_href || "#selected-work"}
href="#selected-work" // 站内结构性锚点,固定不可配
className="inline text-l1 underline underline-offset-[0.08em] decoration-solid decoration-(--label-3) transition-[text-decoration-color] duration-150 ease-out lg:[@media(hover:hover)]:hover:decoration-(--label-1)"
>
{config.about_p2_link_label}
+2 -1
View File
@@ -35,7 +35,8 @@ import { scrollEnv } from "@/lib/scrollEnv";
import ScrambleReveal from "@/components/dom/ScrambleReveal";
import CustomScrollbar from "@/components/dom/CustomScrollbar";
export const PENDING_SCROLL_ANCHOR_SESSION_KEY = "hq:pendingScrollAnchor";
import { PENDING_SCROLL_ANCHOR_SESSION_KEY } from "@/lib/scrollEnv";
export { PENDING_SCROLL_ANCHOR_SESSION_KEY };
const MDX_HEADING_ANCHOR_OFFSET_PX = 96;
const PROSE_CLASS =
+1 -2
View File
@@ -31,7 +31,6 @@ const FIELD_LABELS: Record<keyof SiteConfig, string> = {
about_p1: "关于 · 第一段",
about_p2: "关于 · 第二段(链接前)",
about_p2_link_label: "关于 · 链接文字",
about_p2_link_href: "关于 · 链接地址",
footer_headline: "页脚大字(用 | 分行)",
contact_email: "联系邮箱",
icp_beian: "ICP 备案号(部署国内必填;空则页脚不显示)",
@@ -78,7 +77,7 @@ const GROUPS: { id: string; keys: (keyof SiteConfig)[] }[] = [
"intro_brand",
],
},
{ id: "about", keys: ["about_p1", "about_p2", "about_p2_link_label", "about_p2_link_href"] },
{ id: "about", keys: ["about_p1", "about_p2", "about_p2_link_label"] },
{ id: "footer", keys: ["footer_headline", "contact_email", "icp_beian"] },
{
id: "empty",