GitHub Pages for Project

http://haya14busa.github.io/gh-page-sandbox/

Generate a Site

  1. Press repository Setting buttun
  2. Press the Automatic Page Generator button.
  3. Happy! \("`v")/

Scrach

1.Create gh-pages branch

git checkout --orphan gh-pages
rm .git/index
git clean -fdx

2. echo 'Happy Vimming!' > index.html

3. Add & Commit & Push!

git add index.html
git commit -m 'Happy Vimming!'
git push -u origin gh-pages
URL
http://{username}.github.com/{repository-name}

Jekyll

Plugin

Plugins on GitHub Pages

GitHub Pages is powered by Jekyll, however all Pages sites are generated using the –safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages. – Plugins

Octopress

GitHub Pagesでは通常Jekyllのプラグインは使用できないが、OctopressでローカルにJekyllを動かす->Pushすればプラグインが使える(おそらく)

Jekyll-bootstrap

GitHub PagesでGenerateした場合(Timemachine theme)

cloneしたりごにょごにょ

Convert Markdown

Shell

mkdir _layouts/
git mv index.html _layouts/default.html
vim default.html

いい感じにする

_layouts/default.html

{\% if page.title %}\{\{ page.title }}{\% endif %}
\{\{content}}
etc ...

スラッシュ(\)無視で(反応してしまってダメだった)

_config.yml

markdown: rdiscount

Write Markdown

index.md

---
layout: default
title: Happy Vimming!
---
\("`v")/

Add Gemfile

Gemfile

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

Install

bundle install

Localでチェック

bundle exec jekyll serve -w

-wでwatchして自動ビルド

いい感じになったらgh-pagesにpush

git push -u origin gh-pages

Sub directory

subディレクトリのテスト

_config.yml

markdown: rdiscount
base-url: /gh-page-sandbox

Shell

bundle exec jekyll serve -w -b '/gh-page-sandbox'

これでローカルでもCSS,JSがちゃんと効く(おそらく) URL: http://localhost:4000/gh-page-sandbox/

http://github.com/haya14busa