These are the slides from a workshop I gave at Converge (https://converge.cx) in Glasgow on the 15th of August, 2014.
Jekyll & GitHub PagesSTATIC SITESwith@cobyism • Converge 2014 • Glasgow, Scotland
View Slide
@cobyism
@github
This workshop:• Building sites with Jekyll• Deploying with GitHub Pages
HTMLCSSJAVASCRIPTThings browsers understand:
HTMLCSSJAVASCRIPTYourcontent BrowserThe Job of a Website
HTMLCSSJAVASCRIPTYourcontentBrowserThe Old Fashioned Way
Content ManagementSystems (CMSs)
DatabaseWordpress / Drupal / RailsPackage managementThemes, pluginsServer-sideProcessingPHP / Ruby / Python etc.Content Management SystemsHTMLCSSJAVASCRIPTYourcontent Browser
Using a CMS is often Not Fun™• Backups of content• Framework updates• maintenance, security• Learning curve isn’t really reduced
• Goal: simplicity• Fewer moving parts• Content as codeStatic Site Generators
HTML TemplatesStatic Site GeneratorStatic Site GeneratorsHTMLCSSJAVASCRIPTYourcontent BrowserRegular Files
HTML TemplatesStatic Site GeneratorStatic Site GeneratorsHTMLCSSJAVASCRIPTYourcontent BrowserRegular Filesversion control (YAY!)
• A static site generator• Written in Ruby• Very simple
Ingredients:• A computer• Ruby• Optional: rbenv or RVM (not covered)Building a site with Jekyll
Mac OS X:Installed by default(aww yea)Getting Ruby
Windows:rubyinstaller.orgGetting Ruby
Linux:You probablyalready know how.Getting Ruby
Step 1. Installing Jekyllgem install jekyll
In which Coby tempts fate against the live demo gods.Step 2. Let’s build a site!
Step 3. Deploy to GitHub Pages
• Free service• Host any static site• Jekyll sites are compiledGitHub Pages
Ingredients:• Static website• GitHub.com account• Optional: a beverageDeploying to GitHub Pages
• One per GitHub account• Repository: .github.io• Branch: master• URL: .github.ioUser/Org Pages
• One per repository• Repository name does not matter• Branch: gh-pages• URL: .github.io/Project Pages
• Specify domain in CNAME file in root directory of repository.• Custom domain on User Page repository will cascade to all Project Pages.BYO Domain Names
SHUT UP AND SHOW ME HOWTO GET FREE HOSTING ALREADYStep 3. Deploy to GitHub Pages
Handy tricks
github.com/github/pages-gemgem install github-pagesHandy tricks
Handy tricksbundle installsource “https://rubygems.org”gem “github-pages”Gemfile
Handy trickslanguage: rubyrvm:- 2.1script: bundle exec jekyll buildinstall: bundle install.travis.yml
!------content="0; url={{ page.destination }}" />_layouts/redirect.htmlHandy tricks
import.jekyllrb.comHandy tricksImport your old blog!
alias j='jekyll serve --watch'Instant HTTP server in any directory!Handy tricks
• jekyllrb.com• pages.github.com• help.github.com• support.github.comMore information
Thanks!Follow @cobyism on Twitter (do iiiit!)Email me [email protected]Come say hi later!Slides coby.io/converge-2014