Getting started with Jekyll on Debian 9 Stretch Linux

Objective

The objective is to install Jekyll the static site generator from source or standard on Debian 9 Stretch repository.

Operating System and Software Versions

  • Operating System: – Debian 9 Stretch
  • Software: – jekyll 3.4.3 ( source ) or jekyll 3.1.6 ( Debian Repository)

Requirements

Privileged access to your Debian system is required to install Jekyll packages as well as all prerequisite gems.

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Instructions

Jekyll Installation

Debian Repository

This is by far the most easiest way to install Jekyll on your Linux system. The disadvantage is that depending on your requirements you may end up with although stable but outdated Jekyll version. To install Jekyll run:

# apt install jekyll

Confirm the jekyll installation by querying its version number:

$ jekyll -v
jekyll 3.1.6

Source Installation

Execute the following linux command to install latest Jekyll using gems:

# apt install build-essential ruby-full
# gem install bundler minima jekyll-feed

Confirm the jekyll installation by querying its version number:

$ jekyll -v
jekyll 3.4.3

Create New Project

We are now ready to create a new project. Choose any project name eg. linuxconfig:

$ jekyll new linuxconfig

The above command created a directory called linuxconfig holding a basic jekyll structure of your new application.

$ cd linuxconfig/
$ ls
about.md  _config.yml  Gemfile  Gemfile.lock  index.md  _posts

You may now edit _config.yml main configuration file to set a new name for your website, add description and more. To add new blog posts navigate to _posts directory. There, either edit the sample post or create new one by copying the original sample post giving it a new name while following the same naming format.

View Project Website

Navigate to a newly created directory and start your new project application. Replace the IP address below with your local IP address. If you are not accessing your website remotely you can omit the host option completely and your site will start locally:

$ jekyll serve --host 10.1.1.125

Use your browser to view a following URL http://10.1.1.125:4000/ or if run locally http://127.0.0.1:4000/.

getting started with jekyll on debian 9 stretch linux