In this article, I will help you to configure Jekyll on Ubuntu 22.04 LTS. My previous article showed how to install and run Jekyll on your Ubuntu machine. Jekyll is an amazing static site generator by developers for developers to publish artistic static websites. Instructions in this guide are exclusive to Ubuntu operating systems only. Do not try to use them on Debian or other distributions as packages might break them.
You would need the following setup running already on your system.
- Ruby stack
- Bundler Gem
- Jekyll Gem
Here is how to install them right away.
$ sudo apt-get install ruby-full build-essential zlib1g-dev
$ gem install jekyll bundler
Now your system is ready to run Jekyll.
Step 1. Create a new project
Now I will need a simple command as stated below to create a new project and install the required gems and dependencies.
$ jekyll new jSite
All required gems and dependencies are now installed. The new website has been created.
Step 2. Launch Jekyll Server
It is launch time. You need to apply the following command to launch the Jekyll server in your browser as you can see below.
$ bundle exec jekyll serve
Step 3. Confirm the launch using a browser
Launch your favorite browser to see if everything is working fine.
Step 4. Working with _config.yml File
Now I will guide you to work with _config.yml file which keeps all of the configurations.
You are noticing that there are some critical settings to finish in the above screenshot. Here I will explain each of them.
I will also add some extra variables to improve it further. Any of the data added in _config.yml file is considered a global variable.
title: Here you are supposed to add your website’s title. Let’s be it LinuxWays.Net
email: A global email for many reasons. Change it to [email protected]
description: This is the place where you introduce yourself globally. This can be used anywhere on the site then.
Next, you will provide your domain name linked to your hosting.
Now I will update social links as “linuxways” for both Github and Twitter.
You can see the updated file now.
I used nano to edit _config.yml file. You can use any available editor to use it.
Step 5. Run Jekyll Server Again
Now I am going to run the Jekyll server again to publish the site. First, save the file, and close the editor. You are good to serve the new website.
$ bundle exec jekyll serve
Our static website is ready now and running with max power. You are ready to edit HTML files and CSS to make it the best as desired.
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.