index-by-date.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {% extends "base.html" %}
  2. {% block title %}{{ section.title }}{% endblock title %}
  3. {% block header_logo %}
  4. <p class="header-title">{{ config.title }} | {{ section.title }}</p>
  5. {% endblock header_logo %}
  6. {% block content %}
  7. {{ section.content | safe }}
  8. <div>
  9. <h2>Contents</h2>
  10. <ul>
  11. <!-- List parent -->
  12. {% if section.ancestors | length > 0 %}
  13. {% set parent = section.ancestors | last %}
  14. {% set parent_path = parent | as_str %}
  15. {% set parent_section = get_section(path=parent_path) %}
  16. <li>
  17. <a href="{{ parent_section.permalink }}">Back up</a>
  18. </li>
  19. {% else%}
  20. <li><a href=".">up</a></li>
  21. {% endif %}
  22. <!-- List pages -->
  23. {% set pages_with_dates = section.pages | filter(attribute="date") %}
  24. {% set pages_without_dates = section.pages | filter(attribute="date", value="") %}
  25. {% set sorted_pages_with_dates = pages_with_dates | sort(attribute="date") | reverse %}
  26. {% set sorted_pages = sorted_pages_with_dates | concat(with=pages_without_dates) %}
  27. {% for page in sorted_pages %}
  28. <li>
  29. <p>{% if page.date %}{{ page.date }} &bullet;{% endif %}
  30. <a href="{{ page.permalink }}">{{ page.title }}</a>
  31. </p>
  32. {% if page.description %}
  33. <p>{{ page.description }}</p>
  34. {% elif page.summary %}
  35. <p>{{ page.summary }}</p>
  36. {% else %}
  37. <p>{{ page.title }}....</p>
  38. {% endif %}
  39. </li>
  40. {% endfor %}
  41. <!-- List subsections -->
  42. {% set sorted_section_subsections = section.subsections | sort() %}
  43. {% for section_subsection in sorted_section_subsections %}
  44. {% set subsection = get_section(path=section_subsection) %}
  45. <li>
  46. <a href="{{ subsection.permalink | safe }}">{{ subsection.title }}</a>
  47. </li>
  48. {% endfor %}
  49. </ul>
  50. </div>
  51. {% endblock content %}