使用github+jekyll搭建blog环境,完美替代wordpress

转自http://www.heiniuhaha.com/lessons/2012/08/09/use-jekyll-build-blog/

也来讲讲怎么使用github pages做blog环境

优点

空间免费,github托管,稳定又安全,遭遇过空间商跑路的朋友是不是想起伤心往事;

允许本地服务器调试,脱离网络写文章毫无压力,因为可以使用git命令同步来管理文章,版本控制妥妥的,对技术人员来说,一键恢复,实在是神物;

还能绑定顶级域名,亲,人家免费空间竟然还允许我们绑域名有木有~~;

文章用markedown编写,以前遭受排版困扰的亲们是不是很激动;

购买域名

可以去万网,这两天正好在促销. net-cn-sales

用免费的dnsPod做域名解析

dnspod链接地址https://www.dnspod.cn/ dnspod settings

github注册和本地电脑jekyll等环境配置

参考最底下的参考文章,省略。。。

命令

  1. git命令获取远程文件

    git clone git@github.com:heiniuhaha/heiniuhaha.github.com.git
  2. 定位到目录heiniu.github.com

    cd .ssh/heiniuhaha.github.com
  3. 使用rake命令

    rake page           # Create a new page.
    rake post           # Begin a new post in ./_posts
    rake preview        # Launch preview environment
  4. 写文章的时候学习下markdown语法

    如:中文单引号 ` 用来标注小块代码,如github jekyll

  5. 最后提交git代码

    git add .
    git commit . -m 'just another commit'

日常发布完整命令

git clone git@github.com:heiniuhaha/heiniuhaha.github.com.git//本地如果无远程代码,先做这步,不然就忽略
cd .ssh/heiniuhaha.github.com//定位到你blog的目录下
git pull origin master //先同步远程文件,后面的参数会自动连接你远程的文件
git status //查看本地自己修改了多少文件
git add .//添加远程不存在的git文件
git commit * -m "what I want told to someone"
git push origin master //更新到远程服务器上

参考文章

附件:git api 总结图

链接:http://www.heiniuhaha.com/assets/themes/twitter/pic/git-api.png git api 总结图



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值