新聞發(fā)布
管理系統(tǒng)今年一直推薦的一種寫作方式 markdown語法快速成文,git與github實時保存,jekyll或octopress實時成書或者showoff實時成ppt 入門略有門檻,但是習慣了,寫作效率會好很多 以下以octopress為例,進行說明
配置個人github賬號
登陸github,創(chuàng)建一個個人賬號 假設叫做 rubyonchina
然后回到ubuntu或者Mac里面,仍然是在終端里面,輸入
- [[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
按照默認提示一路確認,生成密鑰之后,將生成的信息復制到github頁面中,如下所示
- [[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | xclip
然后在瀏覽器中打開頁面
https://github.com/account/ssh
點擊,Add another public key,粘貼前面步驟復制的信息,請格外 意,不要在Title中填寫內(nèi)容,直接將復制的內(nèi)容粘貼到Key中,然后點擊 Add Key即可
配置octopress個人博客
- cd ~/dev/
- git clone git://github.com/imathis/octopress.git
- rubyonchina.github.comcd ~/dev/rubyonchina.github.com
修改默認的.rvmrc文件的內(nèi)容為
- rvm use 1.9.2@rails31
安裝相應的gem:
bundle update
然后生成模版文件
rake install
分發(fā)到github上 分發(fā)之前,假設你已經(jīng) 冊用戶名為rubyonchina的github.com賬號,已經(jīng)創(chuàng)建名為rubyonchina.github.com項目
- cd ~/dev/rubyonchina.github.com
- git remote add rubyonchina git@github.com:rubyonchina/rubyonchina.github.com.git
新增一篇測試博客
- rake new_post["post title"]
生成靜態(tài)站點
- rake generate
配置octopress與github的連接
- rake setup_github_pages
按照提示填入你的github項目網(wǎng)址,比如,本示例是
- git@github.com:rubyonchina/rubyonchina.github.com.git
分發(fā)到github上
- rake deploy
第一次運行時,會詢問是否建立對github的授權,輸入 yes 然后將站點更新的內(nèi)容推送到github上
- git push -u rubyonchina master
嘗試瀏覽
http://rubyonchina.github.com
OK!成功!然后,此時,再創(chuàng)建一個新的github的source分支,用于保存寫作的md源文件等
- git add .
- git commit -m "some changes"
- git push rubyonchina source
現(xiàn)在,你就擁有了一個強大的個人站點