Jekyll and Hyde(out) setup

April 23, 2020

Jekyll is a ruby-based static site generator that's perfect for small sites. This post outlines how I set up this site with Jekyll. For a detailed walkthrough, see the instructions on jekyllrb.com.

First, you'll need to install Ruby, and make sure you have >2.5.0. Use rbenv if you need to manage multiple Ruby versions:

# Install rbenv and ruby-build
brew install rbenv
 
# Set up rbenv integration with your shell
rbenv init
 
# Check your installation
LINK=https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor
curl -fsSL $LINK  | bash
 
# Install and use ruby 2.7.1
rbenv install 2.7.1
rbenv global 2.7.1

Now install Jekyll and Bundler

gem install --user-install bundler jekyll

Get your ruby version

ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c)

and add it to your path by adding the following to your shell configuration file, .bash_profile or otherwise:

export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"

Finally, install Jekyll and Bundler:

gem install --user-install bundler jekyll

Theme Setup

Now you can fork the theme you want to use – for this site, I'm using Hydeout – and download it so you can add your content.

In your project directory, create a Gemfile:

bundle init

For Hydeout add jekyll-pageinate, jekyll-gist and jekyll-feed to your Gemfile and run bundle install and bundle update to install everything.

Finally, to get Hydeout to work live, change your baseurl: to http://[username].github.io if you're using Github pages, or the correct domain name otherwise.

You should now be able to build and run with Jekyll:

jekyll build
jekyll serve

Visit http://localhost:4000 to view your site!