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

View file

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