index.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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=".">Back up</a></li>
  21. {% endif %}
  22. <!-- List pages -->
  23. {% set sorted_section_pages = section.pages | sort(attribute="title") %}
  24. {% for page in sorted_section_pages %}
  25. <li>
  26. <p>{% if page.date %}{{ page.date }} &bullet;{% endif %}
  27. <a href="{{ page.permalink }}">{{ page.title }}</a>
  28. </p>
  29. {% if page.description %}
  30. <p>{{ page.description }}</p>
  31. {% elif page.summary %}
  32. <p>{{ page.summary }}</p>
  33. {% else %}
  34. <p>{{ page.title }}....</p>
  35. {% endif %}
  36. </li>
  37. {% endfor %}
  38. <!-- List subsections -->
  39. {% set sorted_section_subsections = section.subsections | sort() %}
  40. {% for section_subsection in sorted_section_subsections %}
  41. {% set subsection = get_section(path=section_subsection) %}
  42. <li>
  43. <a href="{{ subsection.permalink | safe }}">{{ subsection.title }}</a>
  44. </li>
  45. {% endfor %}
  46. </ul>
  47. </div>
  48. {% endblock content %}