Files
gitbook/theme/templates/website/includes/summary.html
T
Samy Pessé 99d9d49610 Improve navigation with non existant entries
Use i18n for introduction title
2015-01-24 12:18:23 +01:00

63 lines
2.4 KiB
HTML

{% macro articles(_articles) %}
{% for item in _articles %}
<li class="chapter {% if item.path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path and not item.external %}data-path="{{ item.path|contentLink }}"{% endif %}>
{% if item.path and item.exists %}
{% if not item.external %}
<a href="{{ basePath }}/{{ item.path|contentLink }}">
<i class="fa fa-check"></i>
{% if item.level != "0" %}
<b>{{ item.level }}.</b>
{% endif %}
{% if item.introduction %}{% i18n "SUMMARY_INTRODUCTION" %}Introduction{% endi18n %}{% else %}{{ item.title }}{% endif %}
</a>
{% else %}
<a target="_blank" href="{{ item.path }}">
<i class="fa fa-check"></i>
{% if item.level != "0" %}
<b>{{ item.level }}.</b>
{% endif %}
{{ item.title }}
</a>
{% endif %}
{% else %}
<span><b>{{ item.level }}.</b> {{ item.title }}</span>
{% endif %}
{% if item.articles.length > 0 %}
<ul class="articles">
{{ articles(item.articles) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}
<div class="book-summary">
<div class="book-search">
<input type="text" placeholder="{% i18n "SEARCH_PLACEHOLDER" %}Type to search{% endi18n %}" class="form-control" />
</div>
<ul class="summary">
{% set _divider = false %}
{% if options.links.sidebar %}
{% for link in options.links.sidebar %}
{% set _divider = true %}
<li>
<a href="{{ options.links.sidebar[loop.key] }}" target="blank" class="custom-link">{{ loop.key }}</a>
</li>
{% endfor %}
{% endif %}
{% if _divider %}
<li class="divider"></li>
{% endif %}
{{ articles(summary.chapters) }}
{% if options.links.gitbook != false %}
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">{% i18n "GITBOOK_LINK" %}Published using GitBook{% endi18n %}</a>
</li>
{% endif %}
</ul>
</div>