section.html 1.1 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. <!-- List parent -->
  8. <div>
  9. <p>Navigation</p>
  10. {% if section.ancestors | length > 0 %}
  11. {% set parent = section.ancestors | last %}
  12. {% set parent_path = parent | as_str %}
  13. {% set parent_section = get_section(path=parent_path) %}
  14. <ul>
  15. <li>
  16. <a href="{{ parent_section.permalink }}">Back up</a>
  17. </li>
  18. </ul>
  19. {% else%}
  20. <ul>
  21. <li>
  22. <a href=".">up</a>
  23. </li>
  24. </ul>
  25. {% endif %}
  26. </div>
  27. <!-- Table of Contents -->
  28. {% if section.toc %}
  29. <div>
  30. <p>Table of Contents</p>
  31. <ul>
  32. {% for h1 in section.toc %}
  33. <li>
  34. <a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
  35. {% if h1.children %}
  36. <ul>
  37. {% for h2 in h1.children %}
  38. <li>
  39. <a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
  40. </li>
  41. {% endfor %}
  42. </ul>
  43. {% endif %}
  44. </li>
  45. {% endfor %}
  46. </ul>
  47. </div>
  48. {% endif %}
  49. {{ section.content | safe }}
  50. {% endblock content %}