From b10aec8d15fba6b21178bc38d7ddbfa6bf9df8a7 Mon Sep 17 00:00:00 2001 From: ClovertaTheTrilobita Date: Sun, 19 Apr 2026 02:20:01 +0300 Subject: [PATCH] update menu actions --- src/components/Posts/PostMenu.astro | 83 ++++++++++++++++++----------- 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/src/components/Posts/PostMenu.astro b/src/components/Posts/PostMenu.astro index a81e4d8..030529f 100644 --- a/src/components/Posts/PostMenu.astro +++ b/src/components/Posts/PostMenu.astro @@ -10,12 +10,7 @@ interface Props { } const { headings = [] } = Astro.props; - -// 只取 h2 / h3,博客目录最常见 const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3); - -// 手机端按钮里显示的“目录: 第一节、xxxxx” -const mobilePreview = tocHeadings[0]?.text ?? "本文目录"; --- { @@ -79,24 +74,16 @@ const mobilePreview = tocHeadings[0]?.text ?? "本文目录"; ) } - +