使用Octopress博客 搭建博客
2014-02-23 12:24
246 查看
Octopress介绍
Octopress是一款优秀的静态化博客系统,也是一个本地化的博客系统,之前部落在介绍免费开源Github Pages空间时有提到过Octopress,Github为我们提供长期稳定的免费空间服务,但是Github空间不是一般意义上的PHP或者ASP空间。Github是一个代码托管空间,我们常用的一些PHP应用程序都无法在Github空间上运行。Octopress作为一个本地化的博客,官方将它简称为:“A blogging framework for hackers.”,也就是Octopress只适合那些经常玩Linux、写代码的朋友用的博客系统。
使用Octopress博客最大的优势就是静态化,不依赖脚本程序,没有MysqL等数据库,因此它可以在一些性能差的服务器或者虚拟空间上运行,在同等条件下打开页面的速度自然也是非常快。 Octopress支持自定义模板,可以markdown,文本文件写作、保存可以直接用dropbox等网盘来同步。另外它还可以让你有git版本控制功能。octopress还有个优点就是它的整个使用/发布是个松耦合的结构,相信一些习惯了代码的朋友很喜欢。
安装步骤
安装ruby 和gemgit clone git://github.com/imathis/octopress.git octopress
进入 octopress 目录输入下面命令进行依赖项的安装
gem install bundler bundle install
输入下面的命令来安装Octopress的默认主题 rake install 到此所有的安装工作已经结束,输入下面的命令可以在本地进行预览
rake preview
在Octopress中添加文章
添加markdown文件rake new_post['my first octopress blog']
会在soruce/_posts目录下生成对应的markdown文件 格式如年-月-日my first octopress blog 编辑完之后执行如下命令,即可将markdown 生成静态的html
rake generate
运行之后在octopress项目的跟目录下回生成对应的html 运行rake preview会启动内部的WebServer输入 localhost:4000既可以浏览博客
将Octopress发布到Github
首先创建好github仓库,仓库名字为kunkun12.github.io,在octopress根目录下运行rake setup_github_pages
输入仓库的地址,之后运行
rake deploy
就可以将本地的内容发布到Github上。
将源码发布到github上,需要推送到仓库中心的分支source
git add . git commit -m “your message” git remote add m git@github.com:kunkun12/kunkun12.github.io.git git push m source
总结
执行rake new_post['title']来生成一个博文;找对生成的markdown文件,编辑内容,当然是使用markdown语法来编辑;
执行rake generate来生成文章;
执行rake preview在本地预览;
执行rake deploy发布到Github中。
执行下面命令将修改的源码推送到source分支:
具体部署资料 参考
/article/4756383.html
/article/4756382.html
http://www.freehao123.com/octopress/
官网 http://octopress.org/
http://octopress.org/docs/blogging/
参考视频http://happycasts.net/episodes/35?autoplay=true
相关文章推荐
- 使用github+octopress搭建个人技术博客
- 使用Octopress搭建静态博客网站
- Octopress 搭建静态博客站点 — 让中文的分类列表(Categories)的超链接正常使用
- 使用github + Octopress 搭建免费博客 + 碰到问题的解决方法
- 使用Octopress在Github上搭建博客系统
- 使用Octopress和Github Pages搭建博客的高级技巧
- Mac下使用Octopress搭建博客详细教程-芒果iOS
- 使用github与Octopress 搭建GitHub Pages博客
- Octopress博客搭建
- Ubuntu上使用octopress+github建立个人博客
- Octopress博客搭建
- 利用Octopress在Github上搭建博客及后续问题总汇
- Octopress + GitHub Page 搭建个人博客
- 用Github和Octopress搭建博客
- 在github Pages上部署octopress搭建个人博客系统
- Windows下搭建Octopress博客
- 在github上搭建octopress博客 Mac
- Mac下利用Octopress和Github搭建自己的技术博客
- 在github上用octopress搭建博客过程纪要
- Windows下搭建Octopress博客