Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbenben committed Sep 21, 2024
1 parent 98899d8 commit 3ed446b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Learndata 升级日志

为了便于后续版本的维护与升级,我会定期发布 Learndata 的新版本,并在此记录所有破坏性更新及其他重要改动。

## 1.3.5

- `docs\.vuepress\theme.ts`:修改配置中的 `plugins.mdEnhance``plugins.markdownImage``plugins.markdownHint`
- `docs\.vuepress\styles\palette.scss`:博客样式结构进行了大幅度的改版。此次改动后,可以直接替换此文件以更新样式。
- `docs\.vuepress\templateBuild.html`:修改了网页模板 `head` 部分的样式定义,以适应新的页面布局和样式需求。
- `package.json`:除了常规依赖项的升级,还新增了对 `sass-embedded` 的依赖。
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ Vercel 部署步骤如下:

### 本地运行 LearnData

1. 为了本地运行,你需要安装 npm 和 pnpm 环境,可参考[环境部署教程](https://newzone.top/deploy/VPS.html#环境部署)
1. 为了本地运行,你需要安装 npm 和 pnpm 环境,可参考[环境部署教程](https://newzone.top/deploy/vps/#环境部署)
2. 将 LearnData 项目下载到本地后,在项目目录下打开终端,输入命令 `pnpm i` 安装依赖。
3. 在终端中输入命令 `pnpm docs:dev`,若成功则会提示访问链接,默认为 `http://localhost:8080/`

本地服务运行后,修改文件时页面会同步更新预览。若需停止本地服务器,可在终端中按下 `Ctrl + C`

## 🆙 版本升级

通常情况下,你不需要升级 LearnData,除非出现依赖报错或需要使用新功能。版本升级时,除了 docs 目录外,所有内容都应使用最新版本的 LearnData 进行覆盖升级,`docs/.vuepress` 中的 `config.ts``theme.ts` 需要与新版文件进行比对,选择性更新。
通常情况下,你不需要升级 LearnData,除非出现依赖报错或需要使用新功能。版本升级时,除了 docs 目录外,所有内容都应使用最新版本的 LearnData 进行覆盖升级,`docs/.vuepress` 中的 `config.ts``theme.ts` 需要与新版文件进行比对,选择性更新。升级日志请查看 [CHANGELOG.md](./CHANGELOG.md)

以下是升级目录的说明:

Expand Down
13 changes: 6 additions & 7 deletions docs/.vuepress/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// toc.scss, navbar.scss, sidebar.scss

// 使用 CSS 的 @import 语法
@import "vidstack/player/styles/default/theme.css";
@import "vidstack/player/styles/default/layouts/audio.css";
@import "vidstack/player/styles/default/layouts/video.css";
Expand All @@ -10,12 +8,13 @@
top: calc(var(--navbar-height) + 5rem);
}

#toc {
/* #toc {
// 增加 toc 与内容区的距离
// left: calc(100% + 2rem);
left: calc(100% + 2rem);
// 隐藏目录文字「此页内容」
// .toc-header {
// visibility: hidden;
// }
.toc-header {
visibility: hidden;
}
}
*/
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ docs

### 看板娘

LearnData 集成了看板娘 [Live2D Widget](https://github.com/stevenjoezhang/live2d-widget),支持随机对话、切换人物服饰和玩打飞机游戏,能提升网站美观度和趣味性。如果不需要看板娘,可以删除 `docs\.vuepress\public` 下的 live2d-widget 文件夹。
LearnData 集成了看板娘 [Live2D Widget](https://github.com/stevenjoezhang/live2d-widget),支持随机对话、切换人物服饰和玩打飞机游戏,能提升网站美观度和趣味性。如果不需要看板娘,可删除 `docs\.vuepress\public` 下的 live2d-widget 文件夹。

如果网站部署在子页面 `https://xxx.github.io/yyy`,则需将子页面路径 yyy 加入到以下两个文件:
如果网站部署在子页面(例如 `https://xxx.github.io/yyy`),则需要将子页面路径 yyy 加入到以下两个文件:

-`docs\.vuepress\public\live2d-widget\autoload.js` 文件第三行的 `const live2d_path = "/live2d-widget/"` 修改为 `const live2d_path = "/yyy/live2d-widget/"`
-`docs\.vuepress\templateBuild.html` 文件中看板娘区块代码 `<script src="/live2d-widget/autoload.js">` 修改为 `<script src="/yyy/live2d-widget/autoload.js">`

如果你想要修改看板娘模型,请参考 `docs\.vuepress\public\live2d-widget` 路径下的 README 和修改说明。如果你想在服务器上自建 [live2d api](https://github.com/fghrsh/live2d_api),请注意添加跨域配置,否则可能会出现只显示文字而不显示看板娘图片的情况
如需调整看板娘模型,请参照 `docs\.vuepress\public\live2d-widget` 目录下的 README 和修改说明。若在服务器上自建 [live2d api](https://github.com/fghrsh/live2d_api),请注意添加跨域配置,以避免仅显示文本而没有看板娘图片的情况。或者,可以使用我提供的看板娘 CDN,修改 `docs\.vuepress\public\live2d-widget\autoload.js` 中 initWidget 的 cdnPath,将 `cdnPath: live2d_path + "live2d_api/"` 更改为 `cdnPath: "https://live2d-api.aishort.top/"`

### 读书笔记

Expand Down Expand Up @@ -126,7 +126,7 @@ waline: {

### 同步到服务器

如果你的项目已经搭建好,但出现了红色的叉叉提示,这可能是 GitHub Actions 同步到服务器时发生了错误。你需要进入项目仓库的「Setting」>「Secrets」>「Action」,并添加 `FTP_HOST``FTP_PORT``FTP_USERNAME``FTP_PASSWORD` 的密钥。之后,每当文件发生变化时,GitHub Actions 就会将修改推送到服务器的 FTP 上。
如果你的项目已经搭建好,但出现了红色的叉叉提示,这可能是 GitHub Actions 同步到服务器时发生了错误。你需要进入项目仓库的「Setting」>「Secrets and variables」>「Action」,并添加 `FTP_HOST``FTP_PORT``FTP_USERNAME``FTP_PASSWORD` 的密钥。之后,每当文件发生变化时,GitHub Actions 就会将修改推送到服务器的 FTP 上。

你也可以参考文章 [GitHub 同步到 OSS](https://newzone.top/deploy/Static.html#同步到-oss),将网页部署到云存储上。

Expand Down Expand Up @@ -203,7 +203,7 @@ Vercel 部署步骤如下:

### 本地运行 LearnData

1. 为了本地运行,你需要安装 npm 和 pnpm 环境,可参考[环境部署教程](https://newzone.top/deploy/VPS.html#环境部署)
1. 为了本地运行,你需要安装 npm 和 pnpm 环境,可参考[环境部署教程](https://newzone.top/deploy/vps/#环境部署)
2. 将 LearnData 项目下载到本地后,在项目目录下打开终端,输入命令 `pnpm i` 安装依赖。
3. 在终端中输入命令 `pnpm docs:dev`,若成功则会提示访问链接,默认为 `http://localhost:8080/`

Expand Down

0 comments on commit 3ed446b

Please sign in to comment.