title: Directory structure of Jekyll tagline: Manage and Create Web sites with Jekyll description: Manage and Create Web sites with Jekyll


:website: jekyllrb.com/ :revnumber: 3.2.1

Folder structure

Jekyll is, at its core, a text transformation engine. The concept behind the system is this: you give it text written in your favorite markup language, be that Markdown, Textile, or just plain HTML, and it churns that through a layout or a series of layout files. Throughout that process you can tweak how you want the site URLs to look, what data gets displayed in the layout, and more. This is all done through editing text files; the static web site is the final product.

A basic Jekyll site usually looks something like this:

source, sh

. ├── _config.yml ├── _drafts | ├── begin-with-the-crazy-ideas.textile | └── on-simplicity-in-technology.markdown ├── _includes | ├── footer.html | └── header.html ├── _layouts | ├── default.html | └── post.html ├── _posts | ├── 2007-10-29-why-every-programmer-should-play-nethack.textile | └── 2009-04-26-barcamp-boston-4-roundup.textile ├── _data | └── members.yml ├── _site ├── .jekyll-metadata └── index.html


Dirs and Files

An overview of what each of these does:

width=“100%”, cols=“4,8”,options=“header”, role=“table-responsive mt-3”

|======================================================================= |File / Directory |Description |`_config.yml` |Stores ../configuration/[configuration] data. Many of these options can be specified from the command line executable but it's easier to specify them here so you don't have to remember them.

|`_drafts` |Drafts are unpublished posts. The format of these files is without a date: `title.MARKUP`. Learn how to ../drafts/[work with drafts].

|`_includes` |These are the partials that can be mixed and matched by your layouts and posts to facilitate reuse. The liquid tag `{% include file.ext %}` can be used to include the partial in `_includes/file.ext`.

|`_layouts` |These are the templates that wrap posts. Layouts are chosen on a post-by-post basis in the ../frontmatter/[YAML Front Matter], which is described in the next section. The liquid tag `{{ content }}` is used to inject content into the web page.

|`_posts` |Your dynamic content, so to speak. The naming convention of these files is important, and must follow the format: `YEAR-MONTH-DAY-title.MARKUP`. The ../permalinks/[permalinks] can be customized for each post, but the date and markup language are determined solely by the file name.

|`_data` |Well-formatted site data should be placed here. The Jekyll engine will autoload all YAML files in this directory (using either the `.yml`, `.yaml`, `.json` or `.csv` formats and extensions) and they will be accessible via `site.data`. If there's a file `members.yml` under the directory, then you can access contents of the file through `site.data.members`.

|`_site` |This is where the generated site will be placed (by default) once Jekyll is done transforming it. It's probably a good idea to add this to your `.gitignore` file.

|`.jekyll-metadata` |This helps Jekyll keep track of which files have not been modified since the site was last built, and which files will need to be regenerated on the next build. This file will not be included in the generated site. It's probably a good idea to add this to your `.gitignore` file.

|`index.html` and other HTML, Markdown, Textile files |Provided that the file has a ../frontmatter/[YAML Front Matter] section, it will be transformed by Jekyll. The same will happen for any `.html`, `.markdown`, `.md`, or `.textile` file in your site's root directory or directories not listed above.

|Other Files/Folders |Every other directory and file except for those listed aboveÔÇösuch as `css` and `images` folders, `favicon.ico` files, and so forthÔÇöwill be copied verbatim to the generated site. There are plenty of ../sites/[sites already using Jekyll] if you're curious to see how they're laid out. |=======================================================================