How To Configure A jekyll Site

On: April 03, 2023


Jekyll is a popular static site generator that allows you to build fast and secure websites without the need for a database. It is easy to set up and use, and it’s perfect for personal blogs or small business websites. In this tutorial, we will guide you through the process of configuring your Jekyll site’s _config.yml file.

Step 1: Creating the _config.yml file

The _config.yml file is the main configuration file for your Jekyll site. It contains settings that control how your site is generated and displayed. To create the file, open your favorite text editor and create a new file called _config.yml in the root directory of your Jekyll site.

Step 2: Setting the site title and description

The first settings you should configure in your _config.yml file are the site title and description. These settings control the text that appears in your site’s header and in search engine results.

title: My Jekyll Site
description: A simple Jekyll site

Step 3: Configuring the site URL

The url setting specifies the base URL of your site. This is used to generate links throughout your site and is also used by Jekyll to construct the site’s sitemap.

url: https://example.com

The permalink setting specifies the URL structure for your site’s pages and posts. By default, Jekyll uses a simple structure that includes the page or post title and the date it was created. However, you can customize this structure to suit your needs.

permalink: /:categories/:title/

This setting will generate URLs that include the post’s category and title.

Step 5: Configuring the theme

Jekyll allows you to use pre-built themes to quickly set up the look and feel of your site. To use a theme, you’ll need to specify it in your _config.yml file.

theme: minima

This setting will use the “Minima” theme, which is the default theme for new Jekyll sites.

Step 6: Configuring other settings

Jekyll has many other settings that you can configure in your _config.yml file. Here are a few examples:

# Exclude files or directories from the site
exclude:
  - Gemfile
  - Gemfile.lock
  - README.md

# Configure plugins
plugins:
  - jekyll-seo-tag

# Set the default language for the site
lang: en

# Set the timezone
timezone: America/New_York

Conclusion

Configuring your Jekyll site’s _config.yml file is an important step in setting up your site. By following the steps in this tutorial, you should now have a basic understanding of how to configure your site’s settings. If you want to learn more about Jekyll, check out the official documentation. To see an example of a full configuration file and a very minimal one, go to this _config.yml Gist


Categories

These can be enabled by uncommenting the section in the config file. You can then link to the category and the user will see all posts on the blog with categories in the front matter.

Jekyll Starter Guides

Read more detailed instructions and documentation on using or contributing to Jekyllgems themes and plugins on my blog. These posts will also ship with your theme / template so you can read them on your own site.