Using Octopress

少于 1 分钟 阅读

Using Octopress

基本用法

  1. 创建新博客:octopress new post 'TITLE'
  2. 构建博客:jekyll build
  3. 本地预览:jekyll serve
  4. 部署到github.io:octopress deploy push
  5. 同步源代码:git add -A && git commit -m 'MSG' && git push

Windows环境搭建

  1. 安装RubyInstaller;
  2. 安装DevKit,在解压后的目录里面执行ruby dk.rb initruby dk.rb install
  3. 切换源:gem sources --add http://gems.ruby-china.org/ --remove https://rubygems.org/
  4. 安装包管理工具,gem install bundler
  5. 在克隆出来的目录中执行bundle install以安装依赖的包;
  6. 安装证书:curl -o C:/windows/ca.perm https://curl.haxx.se/ca/cacert.pem,在执行jekyll命令之前运行命令export SSL_CERT_FILE=c:/windows/cacert.pem
  7. 执行jekyll serve默认监听的端口是4000,和foxit服务(安装了福昕阅读器的计算机都可能有这个服务)冲突,需要关闭该服务或通过修改_config.ymlport: <NEW_PORT>来避开端口冲突。

最新的: