Jekyll

Jekyll is a blog-aware static site generator, written in Ruby. It’s used for Github Pages and it transforms files written in markdown and liquid into a full HTML web.

Installation

Pre-requirements

sudo apt-get install ruby-full build-essential zliblg-dev
sudo gem install jekyll bundler

Configuration

The basic config is under _config.yml

# shows any config mishap
bundle exec jekyll doctor

Usage

If you do changes to your files, it will automatically generate the site. This is useful to see how it will look when deployed.

# creates a myBlog folder with all to start
# use this only the first time
sudo jekyll new myBlog

# inside this folder, starts web server at localhost:4000
sudo bundle exec jekyll serve

Update Ruby Gems

Change the new Gem version at Gemfile. Run bundle install
This will update Gemfile.lock with the new versions to use.

You may also specify at Gemfile to use any versions greater than x and it will take the newest version if there’s any greater. This is done with bundle update.

gem 'jekyll-sitemap', '~> 1.3.1'

Github Pages

Just edit the .md files, do a master push and it will be automatically reloaded.

Posts

Post example

It will be automatically rendered. The code between --- tags is metadata for jekyll.

---
layout: page
title: About
date:   2019-03-01 16:48:18 +0100
categories: [post]
tags: [test, ohno]
permalink: /oh-no/
---

Oh no! This is a new post.

tags vs categories

The difference is a category can be a part of the URL whereas a Tag cannot.

Drafts

Drafts are posts without a date in the filename. They are posts you are still working on and do not want to be published yet. They go under _draft.

To render them, add the --drafts flag to jekyll serve command.

Reference(s)

https://jekyllrb.com/docs/