add archive script tool, which used for packaging to archive and unpacking to restore user data.

This commit is contained in:
PrinOrange
2024-01-01 17:43:09 +08:00
parent d6a6a0cec1
commit a952e24fea
5 changed files with 535 additions and 1 deletions

View File

@@ -153,6 +153,20 @@ npm run build:turbo
- [config.ts](./data/config.ts) :网站的主要配置信息,如网站标题、社交账号、头像、封面图象等。
- [friends.ts](./data/friends.ts) :用于存放友情链接。
### 打包、还原用户数据
本项目可以提供对博客文件、配置等用户数据的一键打包、还原功能,以便于项目升级时迁移或者备份、恢复数据,可以使用脚本工具
```bash
npm run archive
```
来实现。运行脚本后,给你提供打包用户数据和还原用户数据两个选项:`Pack to archive the user data` 和 `Unpack and restore user data` ,分别用于打包归档用户数据和解包恢复用户数据。
来一键打包你的博客文件、配置文件等数据到 `*.tar.gz` 文件。执行脚本时,请输入你要存放的目录即可。
注意:若要恢复用户数据,请一定要注意当前 `./data` 目录下目前存放的用户数据是空的。否则恢复时会覆盖已有的用户数据。
### 一些问题
#### 字体