summary.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% macro articles(_articles) %}
  2. {% for article in _articles %}
  3. <li class="chapter {% if article.path == file.path and not article.anchor %}active{% endif %}" data-level="{{ article.level }}" {% if article.path %}data-path="{{ article.path|resolveFile }}"{% endif %}>
  4. {% if article.path and getPageByPath(article.path) %}
  5. <a href="{{ article.path|resolveFile }}{{ article.anchor }}">
  6. {% elif article.url %}
  7. <a target="_blank" href="{{ article.url }}">
  8. {% else %}
  9. <span>
  10. {% endif %}
  11. {% if article.level != "0" and config.pluginsConfig['theme-default'].showLevel %}
  12. <b>{{ article.level }}.</b>
  13. {% endif %}
  14. {{ article.title }}
  15. {% if article.path or article.url %}
  16. </a>
  17. {% else %}
  18. </span>
  19. {% endif %}
  20. {% if article.articles.length > 0 %}
  21. <ul class="articles">
  22. {{ articles(article.articles, file, config) }}
  23. </ul>
  24. {% endif %}
  25. </li>
  26. {% endfor %}
  27. {% endmacro %}
  28. <ul class="summary">
  29. {% set _divider = false %}
  30. {% if config.links.sidebar %}
  31. {% for linkTitle, link in config.links.sidebar %}
  32. {% set _divider = true %}
  33. <li>
  34. <a href="{{ link }}" target="_blank" class="custom-link">{{ linkTitle }}</a>
  35. </li>
  36. {% endfor %}
  37. {% endif %}
  38. {% if _divider %}
  39. <li class="divider"></li>
  40. {% endif %}
  41. {% for part in summary.parts %}
  42. {% if part.title %}
  43. <li class="header">{{ part.title }}</li>
  44. {% elif not loop.first %}
  45. <li class="divider"></li>
  46. {% endif %}
  47. {{ articles(part.articles, file, config) }}
  48. {% endfor %}
  49. <li class="divider"></li>
  50. <li>
  51. <a href="https://github.com/honkit/honkit" target="blank" class="gitbook-link">
  52. {{ "GITBOOK_LINK"|t }}
  53. </a>
  54. </li>
  55. </ul>