Skip to content

Commit d166491

Browse files
committed
Add table of contents to book pages
We have titles, might as well
1 parent 0f7e5fe commit d166491

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

_includes/book/pages.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
Click a page to view in gallery mode.
44
</p>
55

6+
{% if include.book.titles %}
7+
<div class="uk-card uk-card-default uk-card-body uk-card-small toc">
8+
<ul uk-accordion><li class="uk-open">
9+
<a class="uk-accordion-title" href>Table of Contents</a>
10+
<div class="uk-accordion-content section-list"><ol>
11+
{% for title in include.book.titles %}
12+
<li><a href="#{{ title.text | slugify }}">{{title.text}}</a></li>
13+
{% endfor %}
14+
</ol></div>
15+
</li></ul>
16+
</div>
17+
<br/>
18+
{% endif %}
19+
620
<div uk-lightbox="animation: slide; toggle: .book-page">
721
<div class="uk-child-width-1-1 uk-child-width-1-3@s uk-grid-collapse" uk-grid>
822
{%- unless include.book.no_cover -%}

0 commit comments

Comments
 (0)