1.准备工作
首先你必须要有以下的几样东西:
(1)git,以及github.com帐号,(我这里将blog放置在github上,没有就赶紧注册吧,^_^)
(2)ruby的开发环境,我这使用的Octopress需要Ruby1.9.2,可以使用rbenv或rvm来简单的安装
我使用的是rbenv,简单介绍下安装:
rbenv install 1.9.2-p290
2.安装Octopress,有了它你就可以像黑客一样写博客了哦!兴奋吧,o(∩∩)o...哈哈
git clone git://github.com/imathis/octopress.git octopress
cd octopress
rbenv version # 检查ruby的版本是否是1.9.2
gem install bundler #安装ruby1.9.2下的bundler
rbenv rehash # If you use rbenv, rehash to be able to run the bundle command
bundle install # 安装依赖的组件
rake install # 安装默认的Octopress主题
我使用的是rbenv,如果是rvm,可以查看http://octopress.org/docs/setup/,上面有Octopress更加完整的安装介绍
3.配置github
在github上创建一个仓库,注意仓库名称要以下这种格式yourname.github.com,这样代码发布后自动这个url就可以访问了(此处一定要注意哦,我刚开始没注意,死活没得到想要的效果)。
例如你的 GitHub 帐号是 jack 就将 Repository 命名为 jack.github.com, 完成后会得到一组 GitHub Pages URL http://yourname.github.com/ (注意不能用 https协议,必须用 http协议)。
设定 GitHub Pages
rake setup_github_pages
以上执行后会要求 read/write url for repository :
git@github.com:yourname/yourname.github.com.git
rake generate
rake deploy
等待几分钟后,github上会收到一封信:“[yourname.github.com] Page build successful”,第一次发布后等比较久,之后每次都会直接更新。
当你发布之后,你就可以到 http://yourname.github.com 上看到你的博客了.
当然除了github,也可以使用HeroKu或Rsync,详细介绍:http://octopress.org/docs/deploying/
4.将 source 也加入 git
git add .
git commit -m 'initial source commit'
git push origin source
5.更新 Octopress
日后有 Octopress 新版本发布,使用以下指令升级。
git pull octopress master # Get the latest Octopress
bundle install # Keep gems updated
rake update_source # update the template's source
rake update_style # update the template's style
6.发表新文章
rake new_post["新文章名称"]
会在“source/_posts”目录下自动生成“Timestamp-qing-song-an-zhuang-octopress.markdown”,编辑后即可发布:
rake preview
会在本地启动sinatra服务,用浏览器打开 http://localhost:4000 就可以看到效果了。如果都没有问题就可以发布了。
7.发布
rake gen_deploy
rake deploy #若发布后效果可试试此命令
分享到:
相关推荐
Hackers delight 2nd edition黑客必备
Hackers and Painters,黑客与画家,写的非常不错的一本书,这是英文版的。
Hackers
Addison Wesley - Hackers Delight__ 2002
Linux Kernel Hackers' Guide Due to the fact that nearly every post to this site recently has been either by rude cracker- wannabes asking how to break into other people's systems or a request for ...
Now that storage and collection technologies are cheaper and more precise, methods for extracting ... Machine Learning for Hackers is ideal for programmers from private, public, and academic sectors.
The Web Application hackers book!!!!!!!!!
Linux Basics for Hackers_ Getting Started
car hackers handbook
Linux Hackers-manual 2019 version. Advance your Linux skills
Linux Basics for Hackers 中文版
Bayesian methods for hackers.pdf
Machine Learning for Hackers 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者...
本书直观明了地讲述了计算机算术的更深层次的、更隐秘的技术,汇集了各种编辑的小技巧,包括常购的任务的小算法,2的幂边界和边界检测、位和字节的重排列、整数除法和常量除法、针对整数的基涵义,空间填充曲线、...
Bayesian Methods for Hackers 书的ipynb格式,可以直接用jupyter打开,书中的代码可直接按shift+enter执行
Wiley.The.Oracle.Hackers.Handbook.Jan.2007.chm