main.njk 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. layout: layouts/base.njk
  3. templateClass: elv-default
  4. headerClass: elv-header-default
  5. ---
  6. {% include "header.njk" %}
  7. <main class="elv-layout{% if layoutClass %} {{ layoutClass }}{% endif %}">
  8. <div id="documentation" class="elv-toc">
  9. <div>
  10. {% set navPages = collections.all | eleventyNavigation %}
  11. {% macro renderNavListItem(entry) -%}
  12. <li{% if entry.url == page.url %} class="elv-toc-active"{% endif %}>
  13. <a {% if entry.url %}href="{% if borgmatic.environment == "production" %}https://torsion.org/borgmatic/docs{% else %}http://localhost:8080/docs{% endif %}{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
  14. {%- if entry.children.length -%}
  15. <ul>
  16. {%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
  17. </ul>
  18. {%- endif -%}
  19. </li>
  20. {%- endmacro %}
  21. <ul class="elv-toc-list">
  22. {%- for entry in navPages %}{{ renderNavListItem(entry) }}{%- endfor -%}
  23. </ul>
  24. </div>
  25. </div>
  26. {{ content | safe }}
  27. {% include 'components/suggestion-link.html' %}
  28. </main>