How to make a Jekyll _pages directory

Jekyll is such a clean, lightweight site generator, but it can be hard to keep your project organized if your site uses a lot of pages. Luckily, you can use this Github-Pages-friendly method to create a dedicated _pages directory inside your project, keeping your root directory clear of disorganized bloat. It’s very simple to add this functionality:

  1. In your Jekyll project’s _config.yml, add this line:
include: ['_pages']
  1. Then, create a directory called _pages at the top level of your project.

  2. Add pages to the _pages directory. And give them frontmatter, like this:

title:     My Awesome Page
permalink: /awesome
layout:    page
  1. Frontmatter is very important! The permalink field must be defined for every page in the _pages directory, otherwise you’ll receive a 404. You may also need to change the layout property to match your desired layout.

About the author

I'm Mark Thomas Miller, a full stack engineer and designer currently working at ConvertKit. (We're hiring!) People like Arnold Schwarzenegger, Lindsey Stirling, and Tim Ferriss use features I've built to connect with their fans. I'm currently geeking out about Svelte, mechanical keyboards, and minimalist UI design, and replaying Ocarina of Time.