Github Pages
- Create repository
- Name it
username.github.io
- Click
Settings
- Code and automation -> Build and deployment -> Branch dropdown -> select publishing source
Jekyll
bundle exec jekyll serve
Page
- standalone content w/o date
- ex. about.md
SITE-URL/about
Post
- content w/ date
- put in
_posts
directory
Templates
Can use pages and posts as a template for creating new pages
Change title and description
Edit _config.yaml
front matter
theme: jekyll-theme-minimal
title: Octocat's homepage
description: Bookmark this to keep an eye on my project update
Edit page/post front matter
---
title: This page's title
---
Create a page
- Create
PAGE-NAME.md
in root - Add frontmatter
--- layout: page title: "PAGE-TITLE" permalink: /URL-PATH ---
- Add content of the page
Create a post
- Go to
_posts
directory - Create post file in the format:
YYYY-MM-DD-NAME-OF-POST.md
- Add yaml frontmatter
layout: post title: "POST-TITLE" date: YYYY-MM-DD hh:mm:ss -0000 categories: CATEGORY-1 CATEGORY-2
- Add content of the post
- Load page
https://octocat.github.io/YYYY/MM/DD/TITLE.htm
Setup Local Server
- Install Jekyll
- Clone server onto local computer
- Go into project directory
- Install Bundler
- Specify in a gemfile in project’s root
source 'https://rubygems.org' gem "jekyll" gem "webrick" gem "jekyll-sitemap", "~> 1.4.0" gem "jekyll-gist", "~> 1.5.0" gem 'jekyll-mentions', "~> 1.6.0" gem 'jekyll-feed', "~> 0.15.1" gem "github-pages", "~> 228" gem "jekyll-avatar", "~> 0.7.0" gem 'nokogiri' gem 'rack', '~> 2.2.4' gem 'rspec'
bundle install
- Start server
bundle exec jekyll serve
- Make sure
gem 'github-pages'
is up to datebundle update github-pages