Style tags table

This commit is contained in:
Oliver Davies 2018-01-30 22:41:47 +00:00
parent d9b6d4fbb8
commit 531a7622ee
2 changed files with 33 additions and 12 deletions

View file

@ -1,9 +1,13 @@
{% if page.tags %}
<div class="tags">
{% for tag in page.tags %}
<a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}" class="blue">
{{- tag -}}
</a>
{% endfor %}
<div>
<p>
Tags:
{% for tag in page.tags|sort %}
<a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}" class="blue">
{{- tag -}}
</a>
{%- if not loop.last %},{% endif %}
{% endfor %}
</p>
</div>
{% endif %}

View file

@ -5,10 +5,27 @@ title: Tags
use:
- posts_tags
---
<h2>Tags</h2>
<h1>Blog Tags</h1>
<ul>
{% for tag,posts in data.posts_tags %}
<li><a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}">{{ tag }}</a></li>
{% endfor %}
</ul>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Tag</th>
<th>Number of posts</th>
</tr>
</thead>
<tbody>
{% for tag, posts in data.posts_tags %}
<tr>
<td>
<a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}">
{{ tag }}
</a>
</td>
<td>{{ posts|length }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>