前言
安裝Git并拉取分支洁灵,部署Jekyll
安裝Git
這一步的教程略過 安裝過程可以百度 關(guān)鍵詞 git安裝 git教程
拉取代碼
在項目頁,找到原諒色按鈕”clone or download”復(fù)制鏈接驻龟,通常為”https://github.com/用戶名/項目名.git”。
調(diào)出命令行:
git clone https://github.com/用戶名/項目名.git
安裝Ruby
yum install ruby
如果出現(xiàn)ruby版本過低錯誤缸匪,請參考我另外一篇文章 Centos升級Ruby
安裝Jekyll
gem install jekyll
配置Jekyll
cd jekyll path // 移動到你的jekyll項目下翁狐,也就是你從git里clone下來的項目
jekyll serve // 啟動服務(wù),默認鏈接地址\"http:localhost:4000\
期間遇到的一個問題:
Configuration file: /Users/czre/git/blog/_config.yml
Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly.
Dependency Error: Yikes! It looks like you don't have jekyll-paginate or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-paginate' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
這個原因是因為沒有jekyll-paginate凌蔬,使用gem install jekyll-paginate安裝一下就好了露懒。
另外也有可能出現(xiàn)沒有jekyll-gist錯誤,解決方法同上龟梦,這些錯誤取決模板所采用的一些服務(wù)隐锭。
jekyll server -H 127.0.0.1 --incremental
將此腳本命令設(shè)置為后臺執(zhí)行窃躲,SSH客戶端斷開繼續(xù)執(zhí)行
ctrl + z
bg 1
安裝&配置Nginx
安裝nginx略過
對nginx.conf進行修改计贰,可通過whereis nginx查看具體的nginx.conf的位置
把nginx.conf添加 一個虛擬域名解析(根據(jù)不同的端口或者域名來配置),把監(jiān)聽root目錄為clone下來的文件夾里面_site即可
完成
ngin綁定_site之后蒂窒,即可通過域名或者ip+端口的形式進行訪問了