Wednesday, August 08, 2018

GitHub Page + Jekyll

利用 GitHub Page + Jekyll theme 架設自己的 Blog 方法有數個方式,網上也得多人 提供了參考。在此,只是記錄自己的安裝流程。

架設

  • 必需先有 GitHub 帳號
  • Fork https://github.com/fongandrew/hydeout 到自己的 GitHub 並更名
    • 更名: Settings -> Settings -> Repository name -> 新名稱 -> Rename (更名目前測試會有問題,link 不對)
  • 設定 GitHub Pages
    • Settings -> GitHub Pages -> Source -> gh-pages branch -> Save。設定完後即會顯示出這個 Blog 的連結網址。此時預設的 Blog 即已生成,可以點選連結看看內容。
  • 在 local 端俢改內容並預覽,確定內容後上傳至 GitHub
    # 安裝必要的工具
    gem install bundler jekyll
    
    git clone https://github.com/NienfengYao/hydeout
    cd hydeout
    gie checkout gh-pages
    
    # 啟動 web server,此時便可透過 Browser 預覽內容了
    bundle exec jekyll serve --host 10.63.240.140 --port 4000
    # press ctrl-c to stop
    
    # 新增自己的新文章
    vim _post/2018-08-02-github-jekyll.md
    # 可以再啟動 local server,確認內容
    
    # 上傳修改後的結果至 GitHub
    git push

Reference