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:
- In your Jekyll project’s
_config.yml, add this line:
Then, create a directory called
_pagesat the top level of your project.
Add pages to the
_pagesdirectory. And give them frontmatter, like this:
--- title: My Awesome Page permalink: /awesome layout: page ---
- Frontmatter is very important! The
permalinkfield must be defined for every page in the _pages directory, otherwise you’ll receive a 404. You may also need to change the
layoutproperty to match your desired layout.