两年了终于想要再维护下博客,折腾了两个小时,记录一下,避免以后增加维护成本。

1. 执行 hexo server 展示 help 提示页

首先这个坑,在于hexo d 并没有将对于能够重新部署环境的文件全部上传到github对应仓库。导致clone下来的仓库是无法部署的,简直非常诡异,搞不清楚为什么要这么设计。

执行hexo server 会抛出

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ hexo server
Usage: hexo <command>

Commands:
help Get help on a command.
init Create a new Hexo folder.
version Display version information.

Global Options:
--config Specify config file instead of using _config.yml
--cwd Specify the CWD
--debug Display all verbose messages in the terminal
--draft Display draft posts
--safe Disable all plugins and scripts
--silent Hide output on console

参考官网 issue https://github.com/hexojs/hexo/issues/1442, 照着跑了下没啥用,但是至少能确定少一些配置文件。

2. 找到本地文件

通过find / -n 'xx' ,终于找到了本地文件的地址(泪目,先是将_config.yaml,复制了过去,没啥用。直接暴力将其他文件都上传到github另一个仓库(现在想同一个仓库就行了orz)。项目跑起来了终于。

3. 主题

终于将项目在新电脑本地跑了起来。但是还是无法展示具体页面,猜测下来是主题问题。

以及主题是无法加入仓库的,这个倒是可以理解。

1
2
3
rm -rf node_modules && npm install --force
git clone https://github.com/ahonn/hexo-theme-even themes/even
cp themes/even/_config.yml.example themes/even/_config.yml

终于解决。