Octopress Push 到 Github 之后,就可以對(duì)博客進(jìn)行一些個(gè)性化配置了,這里先介紹一些基本配置。
博客的基本配置文件在 Octopress 目錄下的_config.yml
??梢詫?duì)需要修改的進(jìn)行修改。
# ----------------------- #
# Main Configs #主要參數(shù)
# ----------------------- #
url: http://GeekJacky.github.io #網(wǎng)址
title: JackyStudio #博客標(biāo)題
subtitle: Stay Hungry,Stay Foolish! #副標(biāo)題
author: Jacky #作者
simple_search: http://google.com/search #搜索引擎
description: #描述
subscribe_rss: /atom.xml #rss地址
subscribe_email: #提供Email訂閱的地址
email: #Rss訂閱的Email地址
# ----------------------- #
# Jekyll & Plugins #Jekyll & 插件
# ----------------------- #
# 路徑設(shè)置
root: / #博客路徑
permalink: /blog/:year/:month/:day/:title/ #文章的固定鏈接形式
...
paginate: 10 # 每頁文章數(shù)
pagination_dir: blog # 存放地址
recent_posts: 5 # 顯示最近文章篇數(shù)
excerpt_link: "Read on →" #繼續(xù)閱讀鏈接文字
# 邊欄
default_asides: [asides/recent_posts.html, asides/github.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html]
# ----------------------- #
# 3rd Party Settings #第三方設(shè)置
# ----------------------- #
修改后打開 cmd,運(yùn)行如下命令(可以不預(yù)覽,直接推送)
rake generate
rake preview
rake deploy
http://wiki.jikexueyuan.com/project/github-page/images/jacky.jpg" alt="" />
Octopress 安裝主題也是很簡(jiǎn)單。
Octopress 的 github wiki 提供給我們一大堆主題,還提供了預(yù)覽。當(dāng)然都是有愛的網(wǎng)友開源的,來這里挑吧:https://github.com/imathis/octopress/wiki/3rd-Party-Octopress-Themes
主題的安裝很簡(jiǎn)單:先把主題克隆到本地 Octopress 目錄下的.themes
目錄,運(yùn)行 rake install 命令,推送即可。Octopress 默認(rèn)主題是 classic。當(dāng)然如果你愿意,你也可以 DIY 一個(gè)主題,不過記得分享出來。
$ cd octopress
$ git clone GIT_URL .themes/THEME_NAME
$ rake install['THEME_NAME']
$ rake generate
我看上了 FoxSlide 這款主題,高端大氣上檔次,demo 地址是http://www.adrianartiles.com/,Github 地址是 https://github.com/sevenadrian/foxslide。
打開 git bash 運(yùn)行如下命令:
$ cd Octopress
$ git clone https://github.com/sevenadrian/foxslide .themes/foxslide
$ rake install['foxslide']
$ rake generate
$ rake deploy
http://wiki.jikexueyuan.com/project/github-page/images/gitbash.jpg" alt="" />
到 github.io 看一下,是不是瞬間也洋氣了很多。記得把 source 分支也 push 上去。
http://wiki.jikexueyuan.com/project/github-page/images/newtheme.jpg" alt="" />