使用GitHub/Gitee Pages + hexo搭建个人文档记录
Requirements
- Node.js
- Git
Install Hexo:
1 | $ npm install -g hexo-cli |
若出现permission denied
,请在命令前加sudo
。
新建一个网站
官网给出以下一套命令进行建站。
1 | $ hexo init <folder> |
在当前版本的hexo-cli
,npm install
不需要执行,在init
的时候会安装相应的依赖。
启动服务器
1 | $ hexo server |
默认情况下,访问网址为: http://localhost:4000。
Theme
默认主题存放于<folder>/themes
下,为landscape
。你可以从主题列表中挑选自己喜欢的主题,下载并替换。
下载
1
2
3$ cd themes/
$ git clone https://github.com/probberechts/hexo-theme-cactus.git
$ rm -rf landscape/修改
_config.yml
文件:1
theme: hexo-theme-cactus
重新启动服务器进行预览
1
$ hexo server