blog-by-tag.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. layout: default
  3. ---
  4. {% capture page_subtitle %}
  5. {% if page.description %}
  6. {% capture desc %}{{ page.description }}{% endcapture %}
  7. {{ desc | markdownify }}
  8. {% else %}
  9. Articles tagged with <strong>‘#{{ page.name }}’</strong>
  10. {% endif %}
  11. {% endcapture %}
  12. {% include page/title.html title=page.name subtitle=page_subtitle %}
  13. {% if site.tags[page.slug] %}
  14. {% for post in site.tags[page.slug] %}
  15. {% assign currentdate = post.date | date: "%Y/%m" %}
  16. {% if currentdate != date %}
  17. {% unless forloop.first %}
  18. </ul>
  19. {% endunless %}
  20. <h2 id="y{{post.date | date: "%Y/%m"}}">{% include utils/date_custom_short.html date = post.date %}</h2>
  21. <ul class="related-posts">
  22. {% assign date = currentdate %}
  23. {% endif %}
  24. <li>
  25. <a href="{{ post.url | prepend: site.baseurl }}">
  26. <span>{{ post.title }}</span>
  27. <small>{{ post.date | date: "%d/%m" }}</small>
  28. </a>
  29. </li>
  30. {% if forloop.last %}
  31. </ul>
  32. {% endif %}
  33. {% endfor %}
  34. {% else %}
  35. <p>There are no posts in this tag.</p>
  36. {% endif %}
  37. {% include utils/tag-box.html %}