Mais conteúdo relacionado Semelhante a 像Hackers一样写博客-hustcalm (20) 像Hackers一样写博客-hustcalm2. 写 Blog 的三个阶段
●
●
●
第一阶段,刚接触 Blog ,觉得很新鲜,试着选择一个免费
空间来写。(新浪博客, CSDN ,博客园)
第二阶段,发现免费空间限制太多,就自己购买域名和空
间,搭建独立博客。( Wordpress , VPS )
第三阶段,觉得独立博客的管理太麻烦,最好在保留控制权
的前提下,让别人来管,自己只负责写文章。( Octopress,
Github pages )
4. Jekyll
●
Jekyll (发音 /'dʒiːk əl/ , " 杰克尔 " )是一个静态站点
生成器,它会根据网页源码生成静态文件。它提供了模
板、变量、插件等功能,所以实际上可以用来编写整个
网站。
●
●
参考链接:
像黑客一样写博客— Jekyll 入门
http://www.soimort.org/posts/101/
●
5. Octopress
●
●
A blogging framework built on top of Jekyll for hackers
Octopress is a framework designed by Brandon Mathis for
Jekyll, the blog aware static site generator powering Github
Pages. To start blogging with Jekyll, you have to write your
own HTML templates, CSS, Javascripts and set up your
configuration. But with Octopress All of that is already taken
care of. Simply clone or fork Octopress, install dependencies
and the theme, and you’re set.
8. Am I qualified?
●
使用 octopress 和 github 来管理 blog ,需要:
●
懂一点点 ruby(jekyll)
●
使用 github
●
基本的 git 命令
●
基本的 Markdown 使用
●
基本的 Web 前端知识
10. Ruby
●
使用 rbenv 或者 rvm (推荐使用 rbenv )
●
https://github.com/sstephenson/rbenv
●
https://github.com/sstephenson/ruby-build
●
●
sudo apt-get install build-essential git-core
zlib1g-dev libssl-dev libreadline-dev
rbenv install 1.9.3-p194
11. Octopress
●
git clone git://github.com/imathis/octopress.git octopress
●
cd octopress
●
rbenv version
●
gem install bundler # 安装 ruby 的 bundler
# 检查 ruby 的版本是否 >=1.9.2
rbenv rehash
command
# If you use rbenv, rehash to be able to run the bundle
●
bundle install
# 安装依赖的组件
●
rake install
# 安装默认的 Octopress 主题
●
●
●
Refer to:
●
http://octopress.org/docs/setup/
13. Bring It Together
●
`rake setup_github_pages`
填写 git@github.com
:geekboygo/geekboygo.github.io.git
●
`rake generate`
●
`rake deploy`
●
等待几分钟后, github 上会收到一封
信:“ [geekboygo.github.io] Page build successful” ,第
一次发布后等比较久,之后每次都会直接更新
14. master 和 source 分支
●
●
Octopress 会把代码放在 source 目录下,把生成的
网站放在 _deploy 目录下。并自动将 _deploy 目录
作为 github page 的 master 分支,将包含 source
在内的部分作为 github page 的 source 分支
将 source 加入 git
`git add .`
`git commit -m 'initial source commit'`
`git push origin source`
15. 更新 Octopress
●
●
●
●
git pull octopress master
Octopress
# Get the latest
bundle install
updated
# Keep gems
rake update_source
template's source
# update the
rake update_style
template's style
# update the
17. 绑定域名
●
申请个人域名 (GoDaddy, name.com)
●
●
cd source
●
touch CNAME
●
Echo “your_domainname” > CNAME
●
●
In order to serve the Pages, your DNS needs to point at our server.
If you are serving a top-level domain like example.com, you should
have an A record pointing to 204.232.175.78. If you are using a
subdomain like www.example.com, you should have a CNAME
record pointing to [your-username].github.io
19. 参考链接 - git & github
●
●
git- 简易指南(
http://rogerdudler.github.io/git-guide/index.zh.html)
如何高效利用 GitHub (
http://www.yangzhiping.com/tech/github.html)
●
Github Pages 极简教程(
http://yanping.me/cn/blog/2012/03/18/github-pages-st
ep-by-step/
)
●
20. 参考链接 - Jekyll
●
像黑客一样写博客—— Jekyll 入门( http://www.soimort.org/posts/101/)
●
搭建一个免费的,无限流量的 Blog----github Pages 和 Jekyll 入门(
http://www.ruanyifeng.com/blog/2012/08/blogging_with_jekyll.html)
●
●
Jekyll 建站之旅(
http://calefy.org/2012/03/03/my-process-of-building-jekyll-blog.html)
利用 Jekyll 搭建个人博客(
http://www.mceiba.com/develop/jekyll-introduction.html)
21. 参考链接 - Octopress
●
像 hackers 一样写博客(
http://clark1231.iteye.com/blog/1506553)
●
Blog = GitHub + Octopress (
http://mrzhang.me/blog/blog-equals-github-plusoctopress.html
)
●
使用 Octopress + Github 管理 blog (
http://ishalou.com/blog/2012/10/15/how-to-use-o
ctopress/
)
●
22. 参考链接 - Markdown
●
●
●
Markdown 写作浅谈(
http://www.yangzhiping.com/tech/r-markdown-knitr.html )
Markdown 写作进阶: Pandoc 入门浅谈(
http://www.yangzhiping.com/tech/pandoc.html )
理想的写作环境: Git+Github+Markdown+Jekyll (
http://www.yangzhiping.com/tech/writing-space.html )
●
献给写作者的 Markdown 新手指南( http://jianshu.io/p/q81RER)
●
黑魔法利器 pandoc ( http://yanping.me/cn/blog/2012/03/13/pandoc/ )
●
Markdown : Syntax ( http://markdown.tw/)
●
R 语言忍者秘笈( https://github.com/yihui/r-ninja )
23. Octopress 进阶
●
为已经存在的 github Octopress 配置本地环境(
http://www.360doc.com/content/12/0216/16/10167
83_187128091.shtml
)
●
服务器端 Octopress 搭建及移动方案(
http://lucifr.com/2011/12/21/octopress-on-server-a
nd-portable-scheme/
)
●
Use Jenkins to Auto Build Jekyll and Octopress (
http://b.imf.cc/blog/2013/01/01/use-jenkins-to-auto-b
uild-jekyll-and-octopress/
)