KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

archive.twig 2.0KB

9 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {% extends "layouts/default.twig" %}
  2. {% block content %}
  3. {% if archives %} {# List? (For all/yearly archives) #}
  4. {% if GET.year != null %}
  5. <h1>${ "Archive of %s" | translate | format((archives | first).year) }</h1>
  6. {% else %}
  7. <h1>${ "Archives" | translate }</h1>
  8. {% endif %}
  9. {% for archive in archives %}
  10. {% if GET.year != null %}
  11. <h2><a href="$archive.url">${ archive.timestamp | strftime("%B" | translate) }</a></h2>
  12. {% else %}
  13. <h2><a href="$archive.url">${ archive.timestamp | strftime("%B %Y" | translate) }</a></h2>
  14. {% endif %}
  15. <ul>
  16. {% for post in archive.posts %}
  17. <li>${ post.created_at | strftime("%d" | translate) }: <a href="$post.url">${ post.title | normalize | truncate(70) }</a></li>
  18. {% endfor %}
  19. </ul>
  20. <br />
  21. {% endfor %}
  22. {% endif %}
  23. {% if posts.paginated %} {# Posts? (For daily/monthly archives) #}
  24. {% if archive.depth == "day" %}
  25. <h1>${ "Archive of %s" | translate | format(archive.timestamp | strftime("%B %d, %Y" | translate)) }</h1>
  26. {% endif %}
  27. {% if archive.depth == "month" %}
  28. <h1>${ "Archive of %s" | translate | format(archive.timestamp | strftime("%B %Y" | translate)) }</h1>
  29. {% endif %}
  30. {% for post in posts.paginated %}
  31. {% include "feathers/" ~ post.feather ~ ".twig" %}
  32. {% endfor %}
  33. {% endif %}
  34. {% if not archives and not posts.paginated %} {# No results #}
  35. <h2>${ "No Posts" | translate }</h2>
  36. <p>${ "There aren't any posts in the timeframe you specified." | translate }</p>
  37. {% endif %}
  38. {% endblock %}