1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-12-02 15:27:47 +01:00
gojekyll/example/collections.html

74 lines
1.6 KiB
HTML
Raw Normal View History

2017-08-16 00:55:18 +02:00
---
---
<h1>Collections</h1>
<dl>
{% for c in site.collections %}
{% capture ks %}{% for k in c %}{{ k }} {% endfor %}{% endcapture %}
{% assign ks = ks | split: ' ' | sort %}
<dt> {{ c.label }}</dt>
<dd>Keys: {{ ks | join }}</dd>
<dd>
<table>
{% for k in ks %}
<tr>
<th style="text-align: left; vertical-align: top">{{ k }}</th>
{% if k != 'docs' %}
<td>{{ c[k] }}</td>
{% endif %}
</tr>
{% endfor %}
</table>
</dd>
{% endfor %}
</dl>
<h2>Collection Page</h2>
{% assign p = site.c1.first %}
{% capture ks %}{% for k in p %}{{ k }} {% endfor %}{% endcapture %}
{% assign ks = ks | split: ' ' | sort %}
Keys: {{ ks | join }}
<table>
{% for k in ks %}
<tr>
<th style="text-align: left; vertical-align: top">{{ k }}</th>
<td><pre>{{ p[k] }}</pre></td>
</tr>
{% endfor %}
</table>
<h2>Post</h2>
{% assign p = site.posts.first %}
{% capture ks %}{% for k in p %}{{ k }} {% endfor %}{% endcapture %}
{% assign ks = ks | split: ' ' | sort %}
Keys: {{ ks | join }}
<table>
{% for k in ks %}
<tr>
<th style="text-align: left; vertical-align: top">{{ k }}</th>
<td><pre>{{ p[k] }}</pre></td>
</tr>
{% endfor %}
</table>
<h2>Static File</h2>
{% assign d = site.static_files.first %}
{% capture ks %}{% for k in d %}{{ k }} {% endfor %}{% endcapture %}
{% assign ks = ks | split: ' ' | sort %}
Keys: {{ ks | join }}
<table>
{% for k in ks %}
<tr>
<th style="text-align: left; vertical-align: top">{{ k }}</th>
<td><pre>{{ d[k] }}</pre></td>
</tr>
{% endfor %}
</table>