GitHub Pages

It's really cool that github.com provides personal pages hosting service. You could create your personal or organization website following this instruction, and then you will your own minimal customized blog. :)

User(organization) Site V.S. Project Site

The user(or organization) site uses the master branch as the default branch to generate site, and the project site uses the hg-pages branch to publish.

Jekyll

GitHub Pages also support Jekyll, a simple, blog-aware static site generator. You could easily following Install Jekyll instruction to install Jekyll and run on your local machine.

Running Jekyll Locally

I don't want to install bundle packages in the root filesystem, instead of that, I install bundle packages in the GitHub Pages project directory. Here is the installation. Create a Gemfile file and add the configuration.

$sudo apt-get install ruby ruby-dev gcc
$sudo gem install bundler

$cat Gemfile
source 'https://rubygems.org'
gem 'github-pages'

$bundle install --path vendor/bundle
...
$bundle exec jekyll serve

Exclude Vendor Directory

Add exclude: [vendor] (the installing path of bundle packages) in _config.yml, or you might get some error message like: ERROR: YOUR SITE COULD NOT BE BUILT:

Jekyll in GitHub Pages

Dependency Versions

GitHub Pages only provides the following jekyll plugins. Therefore, you want to using some plugins other than GitHub Pages provides, you may consider run jekyll locally and generate _site then publish the static pages to github.

Add a list of enabled gems (plugins) to your site's _config.yml file, such as: gems: - jekyll-mentions - jemoji - jekyll-redirect-from - jekyll-sitemap

References



Published

27 March 2015

Category

web devilopment

Tags