summaryrefslogtreecommitdiffstats
path: root/theme/templates/book/includes/summary.html
diff options
context:
space:
mode:
Diffstat (limited to 'theme/templates/book/includes/summary.html')
-rw-r--r--theme/templates/book/includes/summary.html63
1 files changed, 63 insertions, 0 deletions
diff --git a/theme/templates/book/includes/summary.html b/theme/templates/book/includes/summary.html
new file mode 100644
index 0000000..8f6e4c8
--- /dev/null
+++ b/theme/templates/book/includes/summary.html
@@ -0,0 +1,63 @@
+{% macro articles(_articles) %}
+ {% for item in _articles %}
+ {% set externalLink = item.path|isExternalLink %}
+ <li class="chapter {% if item.path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path && !externalLink %}data-path="{{ item.path|mdLink }}"{% endif %}>
+ {% if item.path %}
+ {% if !externalLink %}
+ <a href="{{ basePath }}/{{ item.path|mdLink }}">
+ <i class="fa fa-check"></i>
+ {% if item.level !== "0" %}
+ <b>{{ item.level }}.</b>
+ {% endif %}
+ {{ item.title }}
+ </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="Type to search" 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="http://www.gitbook.io/" target="blank" class="gitbook-link">Published using GitBook</a>
+ </li>
+ {% endif %}
+ </ul>
+</div>