大佬,那个标签怎么设置的 #80

Closed
opened 2023-03-03 01:15:52 +08:00 by mafqla · 2 comments
mafqla commented 2023-03-03 01:15:52 +08:00 (Migrated from github.com)

缺少article-data.json

缺少article-data.json
Charles7c commented 2023-03-03 09:32:00 +08:00 (Migrated from github.com)

article-data.json 是通过 collect-article-data.mjs 这个脚本生成的网站数据。
57e1051a01/collect-article-data.mjs (L20)

因为在命令前带上了 node collect-article-data.mjs,所以在运行 pnpm dev、pnpm review、pnpm build 的时候都会执行 collect-article-data.mjs 脚本。

"dev": "node collect-article-data.mjs && vitepress dev docs", 

57e1051a01/package.json (L7-L11)

这部分其实有两个优化点:
1.现在 VitePress 已经支持了一些新的玩法,可以在指定时期做一些处理,这样就可以不用在执行命令的时候都在前面带上 node collect-article-data.mjs 了;
2.VitePress 后续可能会支持 usePageData 类似的网站全部数据 API,这样就更不需要 collect-article-data.mjs 脚本了。

最近工作太忙,还开源了另一个项目,所以没时间适配 VitePress 新 API。如果你有时间的话,非常期待你研究下第1个优化点,顺便帮忙给这个项目 PR 一下。😄

article-data.json 是通过 collect-article-data.mjs 这个脚本生成的网站数据。 https://github.com/Charles7c/charles7c.github.io/blob/57e1051a015f6484f1ae5aafc75ffd585a426eb8/collect-article-data.mjs#L20 因为在命令前带上了 `node collect-article-data.mjs`,所以在运行 pnpm dev、pnpm review、pnpm build 的时候都会执行 collect-article-data.mjs 脚本。 ``` "dev": "node collect-article-data.mjs && vitepress dev docs", ``` https://github.com/Charles7c/charles7c.github.io/blob/57e1051a015f6484f1ae5aafc75ffd585a426eb8/package.json#L7-L11 这部分其实有两个优化点: 1.现在 VitePress 已经支持了一些新的玩法,可以在指定时期做一些处理,这样就可以不用在执行命令的时候都在前面带上 node collect-article-data.mjs 了; 2.VitePress 后续可能会支持 usePageData 类似的网站全部数据 API,这样就更不需要 collect-article-data.mjs 脚本了。 最近工作太忙,还开源了另一个项目,所以没时间适配 VitePress 新 API。如果你有时间的话,非常期待你研究下第1个优化点,顺便帮忙给这个项目 PR 一下。:smile:
mafqla commented 2023-03-03 09:56:36 +08:00 (Migrated from github.com)

好的,谢谢大佬了

好的,谢谢大佬了
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Charles7c/vitepress-theme-blog-charles7c-s1#80
No description provided.