Jekyll文檔系統

安裝Ruby環境

# 安裝rvm 
curl -sSL https://get.rvm.io | bash -s stable

# 引入環境定義。  
# 注意:這個,因系統環境不一致,請根據提示操作。
source ~/.profile

# 查看可用的ruby版本
rvm list known

# 安裝 指定版本(這里安裝1.9.2)
rvm install 1.9.2

# 為特定工作環境定義gemset
rvm --create 1.9.2@jekyll

# 使用阿里gem源
gem source -r https://rubygems.org/
gem source -a http://mirrors.aliyun.com/rubygems/

參考

建立Jekyll 文檔系統

安裝Jekyll

rvm --create 2.2.4@jekyll
rvm use 2.2.4@jekyll
gem install jekyll

準備Github帳號

ssh-keygen -t rsa -b 4096 -C 'eellyphp@eelly.net'
# copy ~/.ssh/id_rsa.pub
# 配置到Github

創建Jekyll文檔系統

  • 創建文檔庫https://github.com/new eellyphp.github.io

  • 檢出文檔庫到本地
    git clone git@github.com:eellyphp/eellyphp.github.io.git

  • 創建jekyll文檔項目

cd eelly.github.io/
jekyll new ./

ls .

[eelly@invo eellyphp]$ ll
total 36
-rw-r--r-- 1 eelly eelly  536 Jun  1 14:20 about.md     # About Page
-rw-r--r-- 1 eelly eelly  891 Jun  1 14:20 _config.yml  # Jekyll Config
drwxrwxr-x 2 eelly eelly 4096 Jun  1 14:20 css
-rw-r--r-- 1 eelly eelly 1291 Jun  1 14:20 feed.xml
drwxrwxr-x 2 eelly eelly 4096 Jun  1 14:20 _includes    # 模板文件
-rw-r--r-- 1 eelly eelly  506 Jun  1 14:20 index.html
drwxrwxr-x 2 eelly eelly 4096 Jun  1 14:20 _layouts     # 布局模板
drwxrwxr-x 2 eelly eelly 4096 Jun  1 14:20 _posts       # 默認文章目錄
drwxrwxr-x 2 eelly eelly 4096 Jun  1 14:20 _sass

記一個筆記

vi _posts/2016-06-01-I-love-U.md

---
layout: post
title: I love U
date: 2016-06-01 13:14
---

I love U.

^_^

啟動本地服務
jekyll build
jekyll server -H 192.168.1.10 -P 8080 -B -w --safe -q

打開瀏覽器訪問http://192.168.1.10:8080.

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容