Data Files

In addition to the built-in variables available from Jekyll, you can specify your own custom data that can be accessed via the Liquid templating system.

Jekyll supports loading data from YAML, JSON, CSV, and TSV files located in the _data directory. Note that CSV and TSV files must contain a header row.

This powerful feature allows you to avoid repetition in your templates and to set site specific options without changing _config.yml.

Plugins/themes can also leverage Data Files to set configuration variables.

The Data Folder

The _data folder is where you can store additional data for Jekyll to use when generating your site. These files must be YAML, JSON, TSV or CSV files (using either the .yml, .yaml, .json, .tsv, or .csv extension), and they will be accessible via

Example: List of members

Here is a basic example of using Data Files to avoid copy-pasting large chunks of code in your Jekyll templates:

In _data/members.yml:

- name: Eric Mill
  github: konklone

- name: Parker Moore
  github: parkr

- name: Liu Fengyun
  github: liufengyun

Or _data/members.csv:

Eric Mill,konklone
Parker Moore,parkr
Liu Fengyun,liufengyun

This data can be accessed via (notice that the file’s basename determines the variable name and therefore one should avoid having data files with the same basename but different extensions, in the same directory).

You can now render the list of members in a template:

{% for member in %}
    <a href="{{ member.github }}">
      {{ }}
{% endfor %}


Data files can also be placed in sub-folders of the _data folder. Each folder level will be added to a variable’s namespace. The example below shows how GitHub organizations could be defined separately in a file under the orgs folder:

In _data/orgs/jekyll.yml:

username: jekyll
name: Jekyll
  - name: Tom Preston-Werner
    github: mojombo

  - name: Parker Moore
    github: parkr

In _data/orgs/doeorg.yml:

username: doeorg
name: Doe Org
  - name: John Doe
    github: jdoe

The organizations can then be accessed via, followed by the file name:

{% for org_hash in %}
{% assign org = org_hash[1] %}
    <a href="{{ org.username }}">
      {{ }}
    ({{ org.members | size }} members)
{% endfor %}

Example: Accessing a specific author

Pages and posts can also access a specific data item. The example below shows how to access a specific item:


    name: David Smith
    twitter: DavidSilvaSmith

The author can then be specified as a page variable in a post’s front matter:

title: sample post
author: dave

{% assign author =[] %}
<a rel="author"
  href="{{ author.twitter }}"
  title="{{ }}">
    {{ }}

For information on how to build robust navigation for your site (especially if you have a documentation website or another type of Jekyll site with a lot of pages to organize), see Navigation.

CSV/TSV Parse Options

The way Ruby parses CSV and TSV files can be customized with the csv_reader and tsv_reader configuration options. Each configuration key exposes the same options:

converters: What CSV converters should be used when parsing the file. Available options are integer, float, numeric, date, date_time and all. By default, this list is empty. encoding: What encoding the files are in. Defaults to the site encoding configuration option. headers: Boolean field for whether to parse the first line of the file as headers. When false, it treats the first row as data. Defaults to true.


      - numeric
      - datetime
    headers: true
    encoding: utf-8
      - all
    headers: false