Creating this Jekyll static site and applying a theme

I wanted to have a play with Ruby and so I’ve used Jekyll, a static site generator written in Ruby, to generate the content for this site. Jekyll is a Ruby Gem, which is essentially some packaged up Ruby code, which outputs HTML content.

As a Ruby first timer everything was pretty straight forward to get to grips with, and once I understood the basic concepts of Gems, GemFiles and Bundler I was quickly all set up and running on MacOS. The quick-start instructions on the Jekyll site are pretty good, and any little problems while trying to get the server running was nothing a little googling couldn’t quickly solve.

After a few attempts creating a new site and playing around with the _config.yml file (this is where your site settings live) I understood the basics and I was ready to get a clean site going with my theme of choice - the TeXt Theme.

To be able to use a particular theme you can simply install the Gem to your Gem library and simply add the following line to your Jekyll site’s Gemfile:.

gem "jekyll-text-theme"

And this line to your Jekyll site’s _config.yml file:

theme: jekyll-text-theme

before then running the following which will pull down the theme gem referenced in your Gemfile to your local machine

bundle install

Jekyll allows you to override any of the theme files with local site versions, just with the caveat that anything you do override will stay as such even if you update the theme to a latter version. Thankfully there is a blank custom.scss allowing you to leave the in-built styling alone and update the theme without loosing any custom changes.

All that’s left to do now is fire up the local server to check out your handy work. Just run the serve command from your site folder.

bundle exec jekyll serve

Just be aware that if there are any environment specific clauses in the code you will need to run with the relevant environment flag for these to apply. e.g.

JEKYLL_ENV=production bundle exec jekyll serve

If you’re having any problems getting a site up and running feel free to get in touch and I’ll be happy to help out.