这几天设计模板,准备给我的工作室做个博客, 迁移到 github上去,好处有四,免费,国外,稳定,数据能有备份,还可以写 blogcn 看不到的东西(你懂的)。
网络的资料,参差不齐,这里记录一下github 的学习。首先我调试的系统:Windows 2003 Server
需要的环境;
Git:http://msysgit.googlecode.com/
Ruby:http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/
DevKit:http://cloud.github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
Python:http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
各个语言编写的:
jekyll:git://github.com/chitsaou/jekyll.git (Ruby)
Octopress:git://github.com/imathis/octopress.git (Ruby)
Opoopress: git://github.com/opoo/opoopress.git (Java)
PMBlog:git://github.com/lizheming/PMBlog.git (php)
hexo :git://github.com/tommy351/hexo.git(Node.js)
Mardown 语法:markdown.tw,或 FreeMarker
容易混淆的是:
你需要创建一个 金盾时时彩.github.io 的库,把文件push到master分支,就可以以http://金盾时时彩.github.io 的方式访问 这个就是所谓的 User Pages
如果你建了一个 金盾时时彩 的库,也叫项目,那么需要push到该库的 gh-pages 分支,然后通过金盾时时彩.github.io/金盾时时彩的形式访问,
这个就是所谓的 Project Pages
登陆模式,有2种,HTTPS,和SSH.一个是设置账号登陆,一个是用SSH KEY。
git config --global user.name "用户名" git config --global user.email "邮箱" git config --global credential.helper cache git config --global credential.helper 'cache --timeout=3600'
git clone https://github.com/工作室/工作室.github.io
cd 工作室.github.io
git add . git commit -m '工作室的博客' git push -u origin master
git add . git commit -m '工作室的博客' git push
我用的Opoopress非开发人员版
op -version 版本 op install 安装环境 op preview 浏览 op deploy 发布
默认站点名称是 site, 可通过参数 -Dsite指定,比如创建新的站,名字叫blog 则使用 op install -Dsite=blog 在你的 C:\github\opoopress 中就会有个目录叫 blog
通过 op install -Dsite=blog 创建的站,要预览的话,也是 op preview -Dsite=blog 如果你的8080端口已经被占用了,可以改端口 op preview -Dsite=blog -Dport=8888 然后就可以 http://xxxx:8888/ 正常访问了
最后要注意,github 限制在1G,单个文件不能超过100M,有50M的文件,就会警告了。