From 37326f6e6e5d165bbebc782aec2ad2e18a0995d4 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 11 Jun 2014 13:43:08 -0400 Subject: [PATCH] Alphabetize tag listing. Fixes #10 --- _layouts/post.html | 2 +- tags.html | 42 ++++++++++++++++-------------------------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/_layouts/post.html b/_layouts/post.html index fe3ca77..598c8fb 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -16,7 +16,7 @@ {% if page.image.feature %}{{ page.title }}{% if page.image.credit %}

Photo Credit: {{ page.image.credit }}{% endif %}{% endif %}

- + {% if page.link %}

{% if page.headline %}{{ page.headline }}{% else %}{{ page.title }}{% endif %}

{% else %} diff --git a/tags.html b/tags.html index b3de699..a7c0be1 100644 --- a/tags.html +++ b/tags.html @@ -5,32 +5,22 @@ title: Tag Index 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 %} + -{% for tag in site.tags %} -

{{ tag[0] }}

-
    - {% assign pages_list = tag[1] %} - {% for post in pages_list %} - {% if post.title != null %} - {% if group == null or group == post.group %} -
  • {{ post.title }}
  • - {% endif %} - {% endif %} - {% endfor %} - {% assign pages_list = nil %} - {% assign group = nil %} -
-{% endfor %} \ No newline at end of file +{% for item in (0..site.tags.size) %}{% unless forloop.last %} + {% capture this_word %}{{ tags_list[item] | strip_newlines }}{% endcapture %} +

{{ this_word }}

+ +{% endunless %}{% endfor %} \ No newline at end of file