本文记录了在windows7下构建hexo环境的步骤。主要包括安装hexo,创建页面,添加tag页面,更换主题,修改主题,添加评论。目的在于快速构建一个实用,漂亮的blog。
安装hexo
前提条件
- 安装Node.js
- 安装Git
- 创建代码库(https://github.com/username/username.github.io.git)
- 删除C:\Users\username.ssh 下所有文件
- Generating a new SSH key and adding it to the ssh-agent
- Adding a new SSH key to your GitHub account
- 本文所有命令都在Git Bash中执行
安装Hexo
|
|
初始化Hexo
|
|
本地查看效果
|
|
启动服务,访问http://localhost:4000 查看效果
发布到github
修改
/_config.yml文件内容 1234deploy:type: gitrepo: https://github.com/username/username.github.io.gitbranch: master发布到github
1$ hexo deploy访问https://username.github.io 查看效果
发布新页面到github
创建页面并发布
123$ hexo new [layout] <title> --创建.md文件$ hexo generate --生成静态页面$ hexo deploy
更换主题
添加标签页面
创建标签一览页面
1hexo new page "tags"添加以下内容到source/tags/index.md
1type: "tags"