What is Jekyll? How to use it?


Jekyll is a static site generator. You give it text written in your favorite markup language and it uses layouts to create a static website.

Published on April 21, 2020 by Ziad Katrib

jekyll informative technology

2 min READ

Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind GitHub Pages, which you can use to host sites right from your GitHub repositories and if you don’t know what GitHub Pages are you can visit on click here or here

Source : Jekyll Docs

To know more and get started with Jekyll you can click here

Installation

Jekyll is a Ruby Gem that can be installed on most systems.

Requirements

  • Ruby version 2.5.0 or above, including all development headers (ruby version can be checked by running ruby -v)
  • Ruby Gems (which you can check by running gem -v)
  • GCC and Make

After Installing the Requirements you can follow these guides:

For detailed install instructions have a look at the guide for your operating system.

Creating a new Jekyll site

We can create a new Jekyll site just by a simple command:

jekyll new my-site

Jekyll will create a new directory named as my-site which is customizable (i.e., you can change the name from my-site to anything you want for example jekyll new brutus).

Changing into the Directory

We have to go inside the directory:

cd my-site

Again, my-site is just a random name which is customizable.

Building the site and making it available on a local server

bundle exec jekyll serve

Browsing your Jekyll site

Browse to http://localhost:4000/

On encountering any problem while building and serving your Jekyll site you can consider visiting to the troubleshooting page