mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-10-04 04:21:33 +00:00
40 lines
1.1 KiB
HTML
40 lines
1.1 KiB
HTML
{% extends "./page.html" %}
|
|
|
|
{% block title %}Table of Contents | {{ title }}{% endblock %}
|
|
|
|
{% macro articles(_articles) %}
|
|
{% for item in _articles %}
|
|
{% set externalLink = item.path|isExternalLink %}
|
|
<li>
|
|
{% if item.path %}
|
|
{% if !externalLink %}
|
|
<a href="{{ basePath }}/{{ item.path|contentLink }}">{{ item.title }}</a>
|
|
{% else %}
|
|
<a target="_blank" href="{{ item.path }}">{{ item.title }}</a>
|
|
{% endif %}
|
|
{% else %}
|
|
{{ item.title }}
|
|
{% endif %}
|
|
{% if item.articles.length > 0 %}
|
|
<ol>
|
|
{{ articles(item.articles) }}
|
|
</ol>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
{% endmacro %}
|
|
|
|
{% block content %}
|
|
<div class="page page-toc">
|
|
<h1>Table of Contents</h1>
|
|
<ol>
|
|
{{ articles(summary.chapters) }}
|
|
|
|
{% if glossary.length > 0 %}
|
|
<li><a href="{{ basePath }}/GLOSSARY.html">Glossary</a></li>
|
|
{% endif %}
|
|
</ol>
|
|
</div>
|
|
{% endblock %}
|
|
|