使用octopress快速建立个人博客

本文介绍如何用Octopress款速搭建你的博客.

Octopress是什么?

一个通过Markdwon语法,快速生成HTML,并可以发布到github等服务器的Ruby开源项目

Octopress有哪些功能?

  • 快速切换主题功能
  • 关联github、facebook、google+
  • 使用disqus获取评论功能
  • 直接部署至githbub

配置octpress

  • 克隆octopress项目,并进行配置
1
2
git clone git://github.com/imathis/octopress.git blog
cd blog
  • 修改.rvmrc文件内容,设置默认ruby版本(如果不使用rvm则不需要),更新相应的gem
1
2
rvm use 1.9.3-p374
bundle update

获取ctopress主题,这个几个比较好的主题3rd Party Octopress Themes

  • 配置主题

    • 使用submodule
      cd your_octopress_dir
      git submodule add https://github.com/alexgaribay/octoflat .themes/octoflat
      rake install['octoflat']
      rake generate
      git submodule update
    
    • 使用github clone
      cd your_octopress_dir
      git clone https://github.com/alexgaribay/octoflat .themes/octoflat
      rake install['octoflat']
      rake generate
    
  • 配置_config.yml

  • 新建一个测试博客

1
rake new_post['hello_word']
  • 生成动态站点
1
rake generate

配置github信息

  • gihtub上新建一个项目

  • 添加远程仓库

1
2
cd blog
git remote add origin git@github.com:justin-lu/justin-lu.github.io.git
  • 配置octopress与github连接
1
rake setup_github_pages
  • 按照提示填入项目地址如:
1
git@github.com:justin-lu/justin-lu.github.io.git
  • 部署到github
1
rake deploy
  • 高级功能
    • 新浪微博秀
    • github
    • 评论
1
2
3
现在你就可以打开
justn.github.io
浏览你的个人blog啦。

Comments