Commit 4af55ba
committed
build: 文档站 logo 复用 public/icons/icon.svg,自动同步而不再单独维护
之前我在 docs/public/logo.svg 重画了一个棱镜+彩虹的 svg,但项目根目录 public/icons/icon.svg 已经有一份精心做的图标(多 facet 渐变 + dropShadow)。两份 logo 各画一遍是浪费,改了一处忘了改另一处会脱钩。
新增 build-scripts/sync-docs-assets.mjs:单源同步脚本,读 public/icons/icon.svg 复制到 docs/public/icon.svg。脚本走 import.meta.url 解析项目根,跨平台 Windows / Unix 都能跑。
package.json scripts 新增 docs:assets 调用同步脚本,docs:dev / docs:build 都先跑一遍 docs:assets。本地与 GitHub Pages workflow 同样走 pnpm run docs:build → 自动同步 → vitepress build。
.gitignore 加 docs/public/icon.svg:源 truth 在 public/icons/icon.svg,docs 那份是同步产物不入库。如果以后维护者改了 public/icons/icon.svg,下次 docs:dev / docs:build 自动同步过来。
VitePress config 与 docs/index.md 里 logo 路径全部从 /logo.svg 改成 /icon.svg。删除冗余的 docs/public/logo.svg。
插件版本升级到 1.0.94。1 parent bf0bee1 commit 4af55ba
6 files changed
Lines changed: 21 additions & 29 deletions
File tree
- build-scripts
- docs
- .vitepress
- public
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments