From 0719d8ba5dfaf675ef345ee4dc7fb8fe3228fe56 Mon Sep 17 00:00:00 2001 From: dsh Date: Tue, 15 Sep 2026 11:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A6=E6=9E=B6=E9=A6=96=E9=A1=B5=E6=94=B9?= =?UTF-8?q?=E6=88=90=E3=80=8C=E5=9C=A8=E8=AF=BB=E3=80=8D=EF=BC=8C=E4=B9=A6?= =?UTF-8?q?=E7=B1=8D=E6=8C=AA=E5=88=B0=20/bookshelf/books/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原来 /bookshelf/ 是书籍页,点顶部导航「书架」直接进书籍, 和「先看在读」的预期相反。 - /bookshelf/ -> 在读页(view="reading") - /bookshelf/books/ -> 书籍页(view="books") - 顶部导航「书架」保持指向 /bookshelf/,现在落在在读页,不用改导航 - 侧栏「馆藏」:在读 -> /bookshelf/,书籍 -> /bookshelf/books/ - /bookshelf/reading/ 这个临时 URL 撤掉(还没上线,没有外链负担) 因为导航的 isCurrent 用的是 startsWith,在 /bookshelf/books/ 下 顶部「书架」仍然是高亮状态,符合预期。 验证 - /bookshelf/ : title「在读 20 本」、id=reading、20 张卡、20 条进度条、 无书籍区块;侧栏「在读」带 aria-current - /bookshelf/books/ : title「书籍」、id=books、已读完分组 6 张、无进度条; 侧栏「书籍」带 aria-current - 顶部导航「书架」href = /bookshelf/ --- README.md | 6 ++++-- docs/操作指南.md | 2 +- src/components/bookshelf-content.astro | 4 ++-- src/data/reading.json | 2 +- src/pages/bookshelf/books.astro | 12 ++++++++++++ src/pages/bookshelf/index.astro | 13 +++++++++---- src/pages/bookshelf/reading.astro | 17 ----------------- 7 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 src/pages/bookshelf/books.astro delete mode 100644 src/pages/bookshelf/reading.astro diff --git a/README.md b/README.md index 22fe85c..0140d7f 100644 --- a/README.md +++ b/README.md @@ -279,8 +279,10 @@ prose-p:leading-[1.78] md:prose-p:leading-[1.85] | 页面 | 路径 | 内容 | 侧栏数量 | |---|---|---|---| -| 书籍 | `/bookshelf/` | 手工书单(`books.json`)+ 微信读书已读完 | 两者相加 | -| 在读 | `/bookshelf/reading/` | 微信读书里没读完的 | 未读完本数 | +| 在读 | `/bookshelf/` | 微信读书里没读完的 | 未读完本数 | +| 书籍 | `/bookshelf/books/` | 手工书单(`books.json`)+ 微信读书已读完 | 两者相加 | + +顶部导航「书架」指向 `/bookshelf/`,所以点进来先落在**在读**页。 两块内容: diff --git a/docs/操作指南.md b/docs/操作指南.md index 700e610..7723a3f 100644 --- a/docs/操作指南.md +++ b/docs/操作指南.md @@ -195,7 +195,7 @@ pnpm preview # 本地预览构建产物(搜索功能只有这里才生效 ## 7.5 刷新「最近在读」 -书架分成两个页面:**书籍** `/bookshelf/`、**在读** `/bookshelf/reading/`,侧栏「馆藏」互相跳转。 +书架分成两个页面:**在读** `/bookshelf/`(顶部导航「书架」的落点)、**书籍** `/bookshelf/books/`,侧栏「馆藏」互相跳转。 「在读」是从微信读书抓来的,数据存在 `src/data/reading.json`。 diff --git a/src/components/bookshelf-content.astro b/src/components/bookshelf-content.astro index a33977e..861118f 100644 --- a/src/components/bookshelf-content.astro +++ b/src/components/bookshelf-content.astro @@ -124,8 +124,8 @@ const recommendBadge = (status?: string) => { {/* 漫画和论文两个分类已移除;在读和书籍现在是两个独立页面,这里是它们的导航 */}