-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
117 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,11 +48,10 @@ | |
|
||
 | ||
|
||
2. 在 `src/config.js` 中设置你的网站名称等信息 | ||
2. 在 `src/config.js` 中设置你的网站名称等信息 | ||
|
||
```javascript | ||
const CONFIG = { | ||
'api_url': '', // 已废弃,可忽略此项 | ||
'ga': 'G-XXXXXX', // 填写 Google Analytics 的 ID,不填也没问题 | ||
'whiteboard_id': '', // 填写白板 ID | ||
'title': '数字花园🌱', // 站点标题 | ||
|
@@ -63,13 +62,17 @@ | |
'About': '2e0bbcb8-fdf7-4cdb-8ee2-9f0651b71550', | ||
'XXXXX':'xxxx-xxxx-xxx' | ||
} | ||
'server': '', // Discord 服务器 ID,非必填,填写后将在网站中显示聊天入口 | ||
'channel': '' // Discord 频道 ID,非必填,填写后将在网站中显示聊天入口 | ||
} | ||
``` | ||
|
||
配置 `pages` 后会显示在网站的右上角,点击会打开对应的卡片: | ||
|
||
 | ||
|
||
`pages` 的配置会影响你的网站首页,目前的规则是:网站会在你的白板中寻找名称为 About 的卡片(不区分大小写),如果不存在,则会将 pages 配置中第 1 个卡片作为首页, | ||
|
||
3. 自定义 LOGO | ||
|
||
在 `public` 目录下替换 `favicon.ico`、`apple-touch-icon.png` 两个文件 | ||
|
@@ -88,6 +91,12 @@ | |
|
||
 | ||
|
||
## 常见问题 | ||
|
||
Q:为什么上传到 Hepta 中的图片无法在网站上显示 | ||
|
||
A:直接在 Heptabase 中上传的图片,目前无法显示,一个解决方案是先将图片传到自己的图床里再放到 Hepta 里。 | ||
|
||
## 一些小技巧 | ||
|
||
### 嵌入 HTML | ||
|
@@ -117,6 +126,112 @@ Bandcamp | |
|
||
 | ||
|
||
## 拉取远程更新 | ||
|
||
当此项目功能更新后你可以通过以下方式同步更新你的网站。 | ||
|
||
首先需要在终端中安装 git 以及安装 [VScode](https://code.visualstudio.com/download) 客户端。 | ||
|
||
### 将自己的项目克隆到本地 | ||
|
||
首先获取你自己的项目 URL | ||
|
||
 | ||
|
||
接下来在终端中操作 | ||
|
||
```shell | ||
git clone "https://github.com/YOURNAME/Heptabase-Blog.git" | ||
``` | ||
|
||
通过以下命令进入项目文件夹 | ||
|
||
```shell | ||
cd Heptabase-Blog | ||
``` | ||
|
||
 | ||
|
||
### 将本地的仓库与上游仓库关联 | ||
|
||
通过在终端中输入以下命令建立关联 | ||
|
||
```shell | ||
git remote add upstream https://github.com/draJiang/Heptabase-Blog.git | ||
``` | ||
|
||
关联成功后,通过以下命令确认是否添加成功 | ||
|
||
```shell | ||
git remote -v | ||
``` | ||
|
||
 | ||
|
||
用以下命令从你的上游仓库获取更新 | ||
|
||
```shell | ||
git fetch upstream | ||
``` | ||
|
||
获取更新成功后,终端可能不会提供任何提示,接着进行下一步:合并上游仓库的更新 | ||
|
||
```shell | ||
git merge upstream/main | ||
``` | ||
|
||
在合并的过程中可能系统会提示你**上游仓库和你的本地仓库存在冲突**,其实就是两个项目中存在差异,需要你手动选择应该如何处理这些冲突。 | ||
|
||
### 在 VSCode 中处理冲突 | ||
|
||
首先打开 VScode,然后打开本地的 Heptabase-Blog 文件夹 | ||
|
||
 | ||
|
||
在左侧的文件列表中,你可能会看到一些红色的文件名称,意味着这些文件中存在冲突,你需要点击这些文件逐个解决冲突。 | ||
|
||
 | ||
|
||
通常 `config.js` 、LOGO 等你需要自行自定义的内容,你可以选择「Accept Current Change」,其他则可以选择「Accept Incoming Change」 | ||
|
||
 | ||
|
||
### 将本地项目推送到自己的 GitHub 仓库中 | ||
|
||
你已经解决了所有的冲突,现在可以将代码提交到你的 GitHub 仓库中,提交成功后 Vercel 会自动更新网站。 | ||
|
||
在终端中分别输入以下命令提交本次更新 | ||
|
||
```shell | ||
git add . | ||
``` | ||
|
||
```shell | ||
git commit -m 'Conflicts resolved' | ||
``` | ||
|
||
推送到 GitHub 仓库中 | ||
|
||
```shell | ||
git push origin main | ||
``` | ||
|
||
### 检查 Vercel 是否更新成功 | ||
|
||
现在,一切都已完成,不过还是要检查一下 Vercel 是否正常完成网站的更新。 | ||
|
||
打开你的 GitHub 项目主页,点击注释 1 位置的图标,注意,根据部署状态这里会分别显示以下几种情况: | ||
|
||
- 🟡:正在部署 | ||
|
||
- ❌:部署失败 | ||
|
||
- ✅:部署成功 | ||
|
||
 | ||
|
||
如果正在部署、部署失败,你可以点击注释 2 查看失败原因。 | ||
|
||
--- | ||
|
||
## 为什么不用其他方式 | ||
|