nfreear / nfreear-blog

My (re-developed) personal blog. A work-in-progress! —
https://nick.freear.org.uk
MIT License
0 stars 1 forks source link

Browse post by tags, ... tag cloud? #11

Open nfreear opened 9 years ago

nfreear commented 9 years ago


(Also: http://charliepark.org/tags-in-jekyll; http://stackoverflow.com/questions/15976495/how-to-url-encode-in-jekyll-liquid)


  {% for site_tag in site.tags %}
    {% assign tag = site_tag | first %}
    {% assign posts = site_tag | last %}

  <h2 id={{ tag | downcase | replace: "+"," " | cgi_escape }} >{{ tag }}</h2>
  <ul>
  {% for post in posts %}
    {% if post.tags contains tag %}
    <li>
      <a href="{{ post.url }}">{{ post.title }}</a>
      <span class="date">{{ post.date | date: "%B %-d, %Y"  }}</span>
    </li>
    {% endif %}
  {% endfor %}
  </ul>
  {% endfor %}