From 596b9e0785e26b928a400d38b5df8eb654b15a8f Mon Sep 17 00:00:00 2001 From: Niclas Darville Date: Thu, 13 Nov 2014 10:30:00 +0100 Subject: [PATCH 1/2] Mentioned CSV extension in docs for data files Since CSV files are supported as collections. --- site/_docs/datafiles.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/_docs/datafiles.md b/site/_docs/datafiles.md index 6fea3f3d..6d5117f8 100644 --- a/site/_docs/datafiles.md +++ b/site/_docs/datafiles.md @@ -23,8 +23,8 @@ Plugins/themes can also leverage Data Files to set configuration variables. As explained on the [directory structure](../structure/) page, the `_data` folder is where you can store additional data for Jekyll to use when generating -your site. These files must be YAML files (using either the `.yml`, `.yaml` or `.json` -extension) and they will be accessible via `site.data`. +your site. These files must be YAML files (using either the `.yml`, `.yaml`, `.json` +or `csv` extension) and they will be accessible via `site.data`. ## Example: List of members From 3014fbd34426dfda67d8112a8920cc0eb1ab30e0 Mon Sep 17 00:00:00 2001 From: Niclas Darville Date: Thu, 13 Nov 2014 16:04:28 +0100 Subject: [PATCH 2/2] Added CSV example for data-file docs --- site/_docs/datafiles.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/site/_docs/datafiles.md b/site/_docs/datafiles.md index 6d5117f8..5c565db8 100644 --- a/site/_docs/datafiles.md +++ b/site/_docs/datafiles.md @@ -44,6 +44,15 @@ In `_data/members.yml`: github: liufengyun {% endhighlight %} +Or `_data/members.csv`: + +{% highlight csv %} +name,github +Tom Preston-Werner,mojombo +Parker Moore,parkr +Liu Fengyun,liufengyun +{% endhighlight %} + This data can be accessed via `site.data.members` (notice that the filename determines the variable name).