github pages 配置

首先去github pages申请一个页面,默认的域名是http://USERNAME.github.io,其中USERNAME是你的github用户名。 github使用jekyll做解析引擎。可以直接克隆一个别人写好的jekyll,然后把上传路径改成自己的,像这样: git clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com cd USERNAME.github.com git remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git git push origin master 这个例子中使用的是jekyll-bootstrap。 写文章 如果装了ruby的话,直接在文件夹下执行 rake post title="a new post" 就可以新建一篇文章。内容支持markdown。 其实就是在_post目录下新建了一个md文件,文件名格式为年-月-日-标题.md。 文件开始是一些元信息,比如本文的md文件开头是这样的: --- layout: post title: "github pages 配置" layout: post title: "github pages 配置" description: "" category: misc tags: [jekyll,github pages,setup] 写好了内容部分,直接`git commit`然后`git push`到master分支就可以了。 comments : provider : disqus disqus : short_name : YOUR_DISQUS_SITE_NAME 你需要去disqus.com注册一个用户,然后在dashboard中新建一个站点,注意把`short_name`设置为配置文件中的那个`YOUR_DISQUS_SITE_NAME`。 $ CHCP 65001 如果是在git bash中的话,需要设置如下环境变量: export LC_ALL = enUS.UTF-8 export LANG = enUS.UTF-8 然后就可以 `jekyll serve --watch`了。 gem uninstall pygments.rb --version ">0.5.0" gem install pygments.rb --version "=0.5.0"" category: misc tags: [jekyll,github pages,setup] --- 写好了内容部分,直接git commit然后git push到master分支就可以了。 ...

2013年7月19日