mirror of
https://github.com/adulau/brouilleursdeblanc.git
synced 2024-11-24 19:17:12 +00:00
Alphabetize tag listing. Fixes #10
This commit is contained in:
parent
5e37436a64
commit
37326f6e6e
2 changed files with 17 additions and 27 deletions
|
@ -16,7 +16,7 @@
|
||||||
{% if page.image.feature %}<img src="{{ site.url }}/images/{{ page.image.feature }}" class="entry-feature-image" alt="{{ page.title }}" {% if site.logo == null %}style="margin-top:0;"{% endif %}>{% if page.image.credit %}<p class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a>{% endif %}{% endif %}
|
{% if page.image.feature %}<img src="{{ site.url }}/images/{{ page.image.feature }}" class="entry-feature-image" alt="{{ page.title }}" {% if site.logo == null %}style="margin-top:0;"{% endif %}>{% if page.image.credit %}<p class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a>{% endif %}{% endif %}
|
||||||
<div class="entry-wrapper">
|
<div class="entry-wrapper">
|
||||||
<header class="entry-header">
|
<header class="entry-header">
|
||||||
<span class="entry-tags">{% for tag in page.tags %}<a href="{{ site.url }}/tags/#{{ tag | cgi_encode }}" title="Pages tagged {{ tag }}">{{ tag }}</a>{% unless forloop.last %} • {% endunless %}{% endfor %}</span>
|
<span class="entry-tags">{% for tag in page.tags %}<a href="{{ site.url }}/tags/#{{ tag }}" title="Pages tagged {{ tag }}">{{ tag }}</a>{% unless forloop.last %} • {% endunless %}{% endfor %}</span>
|
||||||
{% if page.link %}
|
{% if page.link %}
|
||||||
<h1 class="entry-title"><a href="{{ page.link }}">{% if page.headline %}{{ page.headline }}{% else %}{{ page.title }}{% endif %} <span class="link-arrow">→</span></a></h1>
|
<h1 class="entry-title"><a href="{{ page.link }}">{% if page.headline %}{{ page.headline }}{% else %}{{ page.title }}{% endif %} <span class="link-arrow">→</span></a></h1>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
36
tags.html
36
tags.html
|
@ -5,32 +5,22 @@ title: Tag Index
|
||||||
description: "An archive of posts sorted by tag."
|
description: "An archive of posts sorted by tag."
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
|
||||||
|
{% assign tags_list = site_tags | split:',' | sort %}
|
||||||
|
|
||||||
<ul class="tag-box inline">
|
<ul class="tag-box inline">
|
||||||
{% assign tags_list = site.tags %}
|
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
|
||||||
{% if tags_list.first[0] == null %}
|
{% capture this_word %}{{ tags_list[item] | strip_newlines }}{% endcapture %}
|
||||||
{% for tag in tags_list %}
|
<li><a href="#{{ this_word }}">{{ this_word }} <span>{{ site.tags[this_word].size }}</span></a></li>
|
||||||
<li><a href="#{{ tag }}">{{ tag }} <span>{{ site.tags[tag].size }}</span></a></li>
|
{% endunless %}{% endfor %}
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
{% for tag in tags_list %}
|
|
||||||
<li><a href="#{{ tag[0] }}">{{ tag[0] }} <span>{{ tag[1].size }}</span></a></li>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
{% assign tags_list = nil %}
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{% for tag in site.tags %}
|
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
|
||||||
<h2 id="{{ tag[0] }}">{{ tag[0] }}</h2>
|
{% capture this_word %}{{ tags_list[item] | strip_newlines }}{% endcapture %}
|
||||||
|
<h2 id="{{ this_word }}">{{ this_word }}</h2>
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{% assign pages_list = tag[1] %}
|
{% for post in site.tags[this_word] %}{% if post.title != null %}
|
||||||
{% for post in pages_list %}
|
|
||||||
{% if post.title != null %}
|
|
||||||
{% if group == null or group == post.group %}
|
|
||||||
<li><a href="{{ site.url }}{{ post.url }}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time></span></a></li>
|
<li><a href="{{ site.url }}{{ post.url }}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time></span></a></li>
|
||||||
{% endif %}
|
{% endif %}{% endfor %}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{% assign pages_list = nil %}
|
|
||||||
{% assign group = nil %}
|
|
||||||
</ul>
|
</ul>
|
||||||
{% endfor %}
|
{% endunless %}{% endfor %}
|
Loading…
Reference in a new issue