diff --git a/example/_data/csv_data.csv b/example/_data/csv_data.csv index 7520def..bb6b870 100644 --- a/example/_data/csv_data.csv +++ b/example/_data/csv_data.csv @@ -1,2 +1,3 @@ key,value -1,2 +k1,a +k2,b diff --git a/example/_data/file_data.yml b/example/_data/file_data.yml index 6a9e26b..98e2219 100644 --- a/example/_data/file_data.yml +++ b/example/_data/file_data.yml @@ -1 +1,3 @@ -key: data file value +k1: data file value +k2: another value +k0: last value diff --git a/example/_data/json_data.json b/example/_data/json_data.json index 719fdae..504cfdb 100644 --- a/example/_data/json_data.json +++ b/example/_data/json_data.json @@ -1 +1 @@ -{"key": "json data"} +[["k1", "json data"],["k2", "more data"]] diff --git a/example/data.md b/example/data.md index 0be7d9c..d31e519 100644 --- a/example/data.md +++ b/example/data.md @@ -3,11 +3,21 @@ ## YAML data -* {{ site.data.file_data.key }} +{% assign data = site.data.file_data %} + + {% for k in data %} + + {% endfor %} +
{{ k[0] }}{{ k[1] }}
## JSON data -{{ site.data.json_data.key }} +{% assign data = site.data.json_data %} + + {% for k in data %} + + {% endfor %} +
{{ k[0] }}{{ k[1] }}
## CSV data diff --git a/example/index.md b/example/index.md index 73f8fe5..ef3d988 100644 --- a/example/index.md +++ b/example/index.md @@ -10,11 +10,12 @@ variable: page variable * {{ site.static_files.size }} Static Files * {{ site.html_pages.size }} HTML Pages * {{ site.html_files.size }} HTML Files -* {{ site.pages.collections }} Collections +* {{ site.pages.collections.size }} Collections ## Tests * [Archive]({% link archive.md %}) +* [Data]({% link data.md %}) * [Collections]({% link collections.html %}) * [Markdown]({% link markdown.md %}) * [Pages]({% link pages.md %}) @@ -23,6 +24,9 @@ variable: page variable * [Static file]({% link static.html %}) * [Tags]({% link tags.md %}) * [Variables]({% link variables.md %}) + +## Variables + * {{ page.variable }} * {{ site.variable }} -* {{ site.data.file_data.key }} +* {{ site.data.file_data.k1 }}