使用Hexo在github上搭建本身域名的博客

github
html

new repository 命名爲 lichen0921.github.ionode

以 http://lichen0921.github.io 能夠訪問這個代碼倉庫.git

新建一個 CNAME 文件,內容爲github

www.launchercher.com

Hexo

環境須要 Git 和 Node.jsnpm

安裝Hexo

npm install -g hexo

NPM全稱是Node Package Manager,是NodeJs的包管理器瀏覽器

初始化Hexo

mkdir launchercher
cd launchercher
hexo init

生成和預覽

hexo generate
hexo server

或者簡稱bash

hexo g
hexo s

用瀏覽器打開http://localhost:4000 預覽博客hexo

發佈到github

修改_config.ymlide

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

發佈post

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
相關文章
相關標籤/搜索