@@ -10,15 +10,15 @@ import { MdxRepl, Aside } from '@/custom/components/user';
1010import { TabItem , Tabs } from ' astro-pure/user' ;
1111import ReadingCard from ' @/components/shelf/ReadingCard.astro' ;
1212
13- "书架"页面是一个独立的看板, 用于展示您的阅读轨迹. 其所有内容都通过一个单独的 JSON 文件进行管理, 不依赖于任何文章的 frontmatter.
13+ "书架"页面是一个独立的看板, 用于展示您的阅读轨迹. 其所有内容都通过一个单独的 TOML 文件进行管理, 不依赖于任何文章的 frontmatter.
1414
1515## 1. 核心配置文件
1616
17- 您需要维护的唯一文件是位于项目根目录下 ` public/ ` 文件夹中的 ` bookshelf.json ` 。
17+ 您需要维护的唯一文件是位于 ` src/components/shelf/ ` 目录下的 ` bookshelf.toml ` 文件 。
1818
1919## 2. 数据结构详解
2020
21- 该 JSON 文件是一个包含多个“阅读条目”对象的数组. 每个对象代表一张卡片, 其结构如下:
21+ 该 TOML 文件是一个包含多个“阅读条目”对象的数组. 每个对象代表一张卡片, 其结构如下:
2222
2323<Aside type = " note" title = " 字段说明" >
2424| 字段 | 类型 | 是否必需 | 说明 |
@@ -40,17 +40,17 @@ import ReadingCard from '@/components/shelf/ReadingCard.astro';
4040
41411 . ** 撰写笔记** : 像往常一样, 在 ` src/content/blog/ ` 目录下创建您的 ` .mdx ` 笔记文件. 完成文章后, 记下您在 frontmatter 中为它设置的 ` slug ` .
4242
43- 2 . ** 打开配置文件** : 打开 ` public/ bookshelf.json ` 文件.
43+ 2 . ** 打开配置文件** : 打开 ` src/components/shelf/ bookshelf.toml ` 文件.
4444
45- 3 . ** 添加新条目** : 在 JSON 数组中添加一个新的对象 , 代表您读完的这本书. 填写 ` title ` , ` type ` , ` status ` 等信息.
45+ 3 . ** 添加新条目** : 在 TOML 文件中添加一个新的 ` [[items]] ` 条目 , 代表您读完的这本书. 填写 ` title ` , ` type ` , ` status ` 等信息.
4646
47474 . ** 关联笔记** : 在该对象的 ` links ` 数组中, 添加您刚刚记下的笔记 ` slug ` 字符串.
4848
49495 . ** 保存** : 保存文件. 网站下次构建时, 书架页面就会自动更新.
5050
5151## 4. 卡片效果预览
5252
53- 下面是不同类型卡片的渲染效果和对应的 JSON 数据结构。
53+ 下面是不同类型卡片的渲染效果和对应的 TOML 数据结构。
5454
5555### 书籍 (Book) 示例
5656
@@ -70,17 +70,16 @@ import ReadingCard from '@/components/shelf/ReadingCard.astro';
7070 index = { 1 }
7171 />
7272 <Fragment slot = " desc" >
73- ```` json
74- {
75- "title" : " 人类简史" ,
76- "type" : " book" ,
77- "status" : " read" ,
78- "description" : " 从石器时代到人工智能, 一部宏大的人类历史." ,
79- "rating" : 5 ,
80- "identifier" : " 978-7-5086-6074-3" ,
81- "tags" : [" 历史" , " 人类学" ],
82- "links" : [" sapiens-note-1" ]
83- }
73+ ```` toml
74+ [[items ]]
75+ title = " 人类简史"
76+ type = " book"
77+ status = " read"
78+ description = " 从石器时代到人工智能, 一部宏大的人类历史."
79+ rating = 5
80+ identifier = " 978-7-5086-6074-3"
81+ tags = [" 历史" , " 人类学" ]
82+ links = [" sapiens-note-1" ]
8483 ````
8584 </Fragment >
8685</MdxRepl >
@@ -103,17 +102,16 @@ import ReadingCard from '@/components/shelf/ReadingCard.astro';
103102 index = { 2 }
104103 />
105104 <Fragment slot = " desc" >
106- ```` json
107- {
108- "title" : " Attention Is All You Need" ,
109- "type" : " paper" ,
110- "status" : " read" ,
111- "description" : " Transformer 架构的开山之作, 奠定了现代大语言模型的基础." ,
112- "rating" : 5 ,
113- "identifier" : " 10.48550/arXiv.1706.03762" ,
114- "tags" : [" NLP" , " Transformer" ],
115- "links" : [" transformer-explained" ]
116- }
105+ ```` toml
106+ [[items ]]
107+ title = " Attention Is All You Need"
108+ type = " paper"
109+ status = " read"
110+ description = " Transformer 架构的开山之作, 奠定了现代大语言模型的基础."
111+ rating = 5
112+ identifier = " 10.48550/arXiv.1706.03762"
113+ tags = [" NLP" , " Transformer" ]
114+ links = [" transformer-explained" ]
117115 ````
118116 </Fragment >
119117</MdxRepl >
@@ -134,15 +132,14 @@ import ReadingCard from '@/components/shelf/ReadingCard.astro';
134132 index = { 3 }
135133 />
136134 <Fragment slot = " desc" >
137- ```` json
138- {
139- "title" : " Working with TCP Sockets" ,
140- "type" : " article" ,
141- "status" : " reading" ,
142- "description" : " 一篇关于 TCP Socket 编程的优秀文章." ,
143- "sourceUrl" : " https://www.google.com" ,
144- "tags" : [" Network" , " Socket" ]
145- }
135+ ```` toml
136+ [[items ]]
137+ title = " Working with TCP Sockets"
138+ type = " article"
139+ status = " reading"
140+ description = " 一篇关于 TCP Socket 编程的优秀文章."
141+ sourceUrl = " https://www.google.com"
142+ tags = [" Network" , " Socket" ]
146143 ````
147144 </Fragment >
148145</MdxRepl >
0 commit comments