iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 4
0
自我挑戰組

hexo-從初學到入門-again系列 第 4

將你的hexo blog發佈到github上

昨天我們建置好github空間同時也設定了github ssh後,今天我們就要來實際將我們的blog發佈到github上了,走到這一步終於可以看見blog的面貌了!

但是,等等,發佈到github前我們需要再hexo的config.yml作一些設定

  • 首先安裝自動發佈到github的npm套件hexo-deployer-git
    $ npm install hexo-deployer-git --save

  • 接著設定hexo中的config.yml檔

https://ithelp.ithome.com.tw/upload/images/20171219/20107307BdePeLZkC3.png

先找到以下程式碼

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type:

接著修改成

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: git
  repository:  git@github.com:github帳號/github帳號.github.io.git
  branch: master
  • 接著我們就可以利用我們day2曾經看過的指令,輸入完即可發布
$ hexo clean  //刪除已經建立的靜態網頁
$ hexo g //產生新的靜態檔案
$ hexo d //發佈到git

https://ithelp.ithome.com.tw/upload/images/20171219/20107307R5fdm0KRL9.png

https://ithelp.ithome.com.tw/upload/images/20171219/20107307WGlaUlpEos.png

https://ithelp.ithome.com.tw/upload/images/20171220/20107307BNh0ZQRIdQ.png

https://ithelp.ithome.com.tw/upload/images/20171220/201073078P1sHgj0hR.png

這樣我們就發佈成功了,來看看結果吧!

https://joseph2068.github.io/


上一篇
GitHub創建靜態網頁-day3
下一篇
hexo更改theme-day5
系列文
hexo-從初學到入門-again5
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言