滴水穿石

海纳百川,有容乃大;壁立千仞,无欲则刚

Octopress 配置

安装rvm,用rvm来安装 Ruby 1.9.2

1
yum install rvm

安装 Ruby 1.9.2

1
rvm install 1.9.2 && rvm use 1.9.2

安装 Octopress

1
2
git clone git://github.com/imathis/octopress.git octopress
cd octopress

安装 bundler

1
2
gem install bundler
bundle install

如果在安装 bundler 出现以下错误

1
2
3
4
ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand

这是由于缺少zlib openssl 库的支持,安装zlib和openssl

1
2
3
4
5
6
7
8
cd /usr/local/rvm/src/ruby-1.9.2-p320/ext/zlib
ruby ./extconf.rb
make
make install
cd /usr/local/rvm/src/ruby-1.9.2-p320/ext/openssl
ruby ./extconf.rb
make
make install

安装默认主题

1
rake install

部署

1
2
3
4
5
6
7
8
git clone git@github.com:yourname/project.git
cd project
rake setup_github_pages
rake generate
rake deploy
git add .
git commit -am "   "
git push git@github.com:yourname/project.git HEAD:source

配置comments和社交网络工具

  • 在_config.yml中增加一项: weibo_share: true
  • 修改source/_includes/post/sharing.html,增加
1
2
3
{%  if site.weibo_share %}
	{% include post/weibo.html %}
{% endif %}