GitHub/Gitee Pages + Hexo

使用GitHub/Gitee Pages + hexo搭建个人文档记录

使用GitHub/Gitee Pages + hexo搭建个人文档记录

Requirements

  • Node.js
  • Git

Install Hexo:

1
2
3
4
5
$ npm install -g hexo-cli
$ npm ls -g --depth=0
/usr/local/lib
├── hexo-cli@1.1.0
└── npm@6.4.1

若出现permission denied,请在命令前加sudo

新建一个网站

官网给出以下一套命令进行建站。

1
2
3
4
$ hexo init <folder>
$ cd <folder>

$ npm install

在当前版本的hexo-clinpm 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
Docker Deploy Test You Don't Know JS
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×