您的位置:首页 > 编程语言

octopress+github管理个人博客

2014-09-27 11:43 441 查看

1 简介

github相当于服务器可以通过域名方式来访问个人主页,octopress相当于专门用来进行网页编辑的工具,所以出现了octopress+github搭配。当然,如果会其它的网页编辑工具,完全可以不用octopress.

2 创建github

repo在github上创建个人主页项目,很简单,分为四步:

a,新建repo,命名方式为:username.github.com.git;其中usrname为你实际登陆github的账号名称;

3 octopress安装

git clone下octopress,直接编译会报错。通过如下命令,可以编译通过。

sudo apt-get install ruby1.9.1-full

you can execute command:

$sudo update-alternatives --config ruby

to select the altiernative ruby which you have installed.and then, execute below commands to finish the octopress deploy:

$git clone https://github.com/pipitang/octopress.git
$cd octopress/

$sudo gem install bundler

$sudo gem install RedCloth -v '4.2.9'

$bundle install

$rake install

below commands you can find from octopress deploy guideline page:

$rake setup_github_pages

$sudo rake setup_github_pages

$sudo rake generate

$sudo rake deploy
安装过程中可能会碰到一些编译问题,  can not find java runtime

sudo apt-get install nodejs。

4 Conclusion

提交rake deploy后,就将生成的index.html等文件后提交到了usrname.github.com.git上。最后需要将octopress修改后的源码提交到git上去。

在octopress目录下,执行git push origin source,username.github.com.git上会新增source branch来保存octopress 源码。
最后,通过username.github.com可以来预览博客了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: