main.njk 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. {% if page.url != '/search/' %}
  10. <div id="search-entrance">
  11. 🔍
  12. <form action="/borgmatic/search/">
  13. <label>
  14. <input type="search" name="query" placeholder="Search">
  15. </label>
  16. </form>
  17. </div>
  18. {% endif %}
  19. <div>
  20. {% set navPages = collections.all | eleventyNavigation %}
  21. {% macro renderNavListItem(entry) -%}
  22. <li{% if entry.url == page.url %} class="elv-toc-active"{% endif %}>
  23. <a {% if entry.url %}href="{% if borgmatic.environment == "production" %}https://torsion.org/borgmatic{% else %}http://localhost:8080/borgmatic{% endif %}{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
  24. {%- if entry.children.length -%}
  25. <ul>
  26. {%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
  27. </ul>
  28. {%- endif -%}
  29. </li>
  30. {%- endmacro %}
  31. <ul class="elv-toc-list">
  32. {%- for entry in navPages %}{{ renderNavListItem(entry) }}{%- endfor -%}
  33. </ul>
  34. </div>
  35. </div>
  36. {{ content | safe }}
  37. {% include 'components/suggestion-link.html' %}
  38. </main>