博客迁移 github pages

很早就说要搬到github上。这个是一个必然的趋势。因此这个星期必定要搬走。而后开始研究vim-plunginhtml

首先使用jekyll 的octopress的框架,感受这个写的不是很好,接口有点别扭。特别是分支的问题上。不过问题不大git

准备工做:ruby --->sudo apt-get install ruby1.9.3github

 

github上的建立一个账号username.github.com   (github pages 有两种方式,第一中相对来讲域名上简单过程不清晰,第二中github pages project 过程清晰域名麻烦点)vim

git clone git://github.com/imathis/octopress.git octopress&& cd octopress
gem install bundler
bundle install
rake install
(没有mardown 代码高亮确实很差看,没事,迁移成功就行了)
rake setup_github_pages  ---》这边有两种状况 若是没有经过ssh-keys  就不要使用git@github 是用https使用密码帐户登陆
rake generate
rake deploy
 
等一会,访问username.github.io 就能够看到blog还不错。
这个时候咱们上传的是通过ruby编译的html静态页面。因此呢咱们须要将这个ruby的编译源码保存到咱们的github 分支上
git add .
git commit -m 'save source code'
git push origin source
-----------------------------------------------------------------------------------
 
而后重点来了,忽然有一天我在别的电脑上想写博客怎么办呢?
 
想一想咱们ruby的源码有了,静态页面也有了,咱们该怎么作呢?一开是我也困在这里,其实最关键的就是在于这里。
首先
git clone "git@github.com:username/username.github.io.git"
cd username.github.io.git
git checkout source #调出源码
git clone "git@github.com:username/username.github.io.git"  _deploy
这个时候咱们就能够经过源码修改静态的页面,而后上传,因此呀octopress脚本我感受学的很差,太罗嗦了,调用也不明朗。
 
----------------------------------------------------------
 我感受jekyll 本省是比较简单的,通过这么封装后变的更复杂了。
 
 
 
博客基本迁移成功至于octopress的主题要怎么弄仍是有时间再说
相关文章
相关标签/搜索