1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-26 19:34:52 +01:00

Refine data page example

This commit is contained in:
Oliver Steele 2017-08-20 17:33:04 -04:00
parent 56a7d8474d
commit aed6802999
5 changed files with 24 additions and 7 deletions

View File

@ -1,2 +1,3 @@
key,value
1,2
k1,a
k2,b

1 key value
2 1 k1 2 a
3 k2 b

View File

@ -1 +1,3 @@
key: data file value
k1: data file value
k2: another value
k0: last value

View File

@ -1 +1 @@
{"key": "json data"}
[["k1", "json data"],["k2", "more data"]]

View File

@ -3,11 +3,21 @@
## YAML data
* {{ site.data.file_data.key }}
{% assign data = site.data.file_data %}
<table>
{% for k in data %}
<tr><td>{{ k[0] }}</td><td>{{ k[1] }}</td>
{% endfor %}
</table>
## JSON data
{{ site.data.json_data.key }}
{% assign data = site.data.json_data %}
<table>
{% for k in data %}
<tr><td>{{ k[0] }}</td><td>{{ k[1] }}</td>
{% endfor %}
</table>
## CSV data

View File

@ -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 }}