github

new repository 命名为 lichen0921.github.io

以 http://lichen0921.github.io 可以访问这个代码仓库.

新建一个 CNAME 文件,内容为

www.launchercher.com

Hexo

环境需要 Git 和 Node.js

安装Hexo

npm install -g hexo

NPM全称是Node Package Manager,是NodeJs的包管理器

初始化Hexo

mkdir launchercher
cd launchercher
hexo init

生成和预览

hexo generate
hexo server

或者简称

hexo g
hexo s

用浏览器打开http://localhost:4000 预览博客

发布到github

修改_config.yml

deploy:
  type: github
  repository: https://github.com/lichen0921/lichen0921.github.io.git

发布

hexo deploy

简称

hexo d

bug处理

npm install hexo-renderer-ejs --save
npm install hexo-renderer-stylus --save
npm install hexo-renderer-marked --save

更换pacman主题

git clone https://github.com/A-limon/pacman.git themes/pacman

然后将_config.yml中的theme修改为:pacman

同时修改E:\launchercher\hexo\node_modules\hexo-renderer-stylus\index.js

stylus
    ...
    .set('compress', true)

如果发现没效果,可以

rm -rf public
hexo clean
rm -rf .deploy
hexo g
hexo s
hexo d

Create a new post

bash $ hexo new "My New Post"

More info: Writing

Run server

bash $ hexo server

More info: Server

Generate static files

bash $ hexo generate

More info: Generating

Deploy to remote sites

bash $ hexo deploy

More info: Deployment


域名解析

记录类型  主机记录      记录值
   A        @     103.245.222.133
 CNAME     www    lichen0921.github.io

本文转自chainli 51CTO博客,原文链接:http://blog.51cto.com/lichen/1559579,如需转载请自行联系原作者