Hexo&Github快速搭建个人Blog

准备工作

1
2
3
4
5
6
#git 
sudo apt-get install git-core
#nodejs
sudo apt install nodejs
#npm
sudo apt intall npm

安装Hexo

1
$ npm install -g hexo-cli

本地测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#在Public下创建Blog目录
npm install hexo-deployer-git --save
hexo init
hexo server
#####
INFO Checking dependencies
INFO Validating the configuration file
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

$ pwd; tree -L 1
/home/me/Public/Blog
.
├── _config.yml #配置文件
├── db.json 
├── debug.log #日志
├── node_modules  #依赖包
├── package.json  #清单
├── package-lock.json #详细清单
├── public #3w文件
├── scaffolds #文章生成模板
├── source
└── themes

修改主题

theme-next/hexo-theme-next: Elegant and powerful theme for Hexo.
hexo-theme-icarus

Simplest way to install is by cloning the entire repository:

1
2
$ cd Blog
$ git clone https://github.com/theme-next/hexo-theme-next themes/next

搭桥连接github

修改根目录下的_config.yml文件.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: https://github.com/AlphaAlgorithms/AlphaAlgorithms.github.io.git
branch: master
email: igabriel_improve@live.com
name: AlphaAlgorithms

# URL 可以不修改
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://alphaalgorithms.github.io/
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

日常运维的步骤:

1
2
3
4
hexo new
hexo clean
hexo generate
hexo deploy

访客统计:

GoStats — Web Analytics - learn even more about your customers

绑定域名

解析alpha.algorithms…

Log

  • Changed to next-theme 2019-05-08

参考资料

官方文档

Hexo
建站 | Hexo

搭建步骤

超详细Hexo+Github博客搭建小白教程 - 知乎

limedroid/HexoLearning: Hexo博客搭建全攻略

手把手教你用Hexo搭建个人技术博客 - 掘金

How to create and sync your blog using hexo | Xiaoyu Liu

GitHub Pages | Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.

配置参考

EnjoyToShare