问题:两块内容挤在 /bookshelf/ 一页里,往下滚就从「在读」滑进「书籍」,
不像两个分类该有的样子。
拆法
- src/pages/bookshelf.astro -> src/pages/bookshelf/index.astro(书籍页)
- 新增 src/pages/bookshelf/reading.astro(在读页)
- 两页共用 bookshelf-content.astro,只多收一个 view: "reading" | "books",
决定渲染哪一块;外壳(页眉/侧栏/页脚/样式)完全同一份,样式不会跑偏
- 在读页标题带真实本数:「在读 20 本 | 时之刃的小站」
侧栏「馆藏」改成真导航
- 在读 -> /bookshelf/reading/,数量 = 未读完本数(20)
- 书籍 -> /bookshelf/,数量 = 手工书单 + 微信读书已读完(0 + 6 = 6)
原来这里只算 books.json 的 total,所以显示 0,正是截图里的问题
- 当前页用 aria-current="page" + 主色底高亮
页面互相不串
- /bookshelf/ : id=books、搜索框、已读完分组 6 张、无在读区块、0 条进度条
- /bookshelf/reading/: id=reading、在读卡片 20 张、20 条进度条、无书籍区块、
无搜索框、无已读完分组、0 张 data-weread-card
顺带更正 README 首段还写着的「读书/论文/漫画书架」。
13 lines
385 B
Plaintext
13 lines
385 B
Plaintext
---
|
|
import BaseLayout from "@/layouts/BaseLayout.astro"
|
|
import BookshelfContent from "@/components/bookshelf-content.astro"
|
|
import { siteTitleSuffix } from "@/data/site"
|
|
|
|
const title = `书籍 | ${siteTitleSuffix}`
|
|
const description = "我的阅读记录与书籍推荐"
|
|
---
|
|
|
|
<BaseLayout {title} {description} fontProfile="interface">
|
|
<BookshelfContent view="books" />
|
|
</BaseLayout>
|