Toggle table of contents via front matter (#1310)
* Add jekyll-toc include * Reduce whitespace generated by comments * Add table of contents include to `single` layout * Replace `toc` include with jekyll-toc enabled YAML Front Matter * Update README * Update table of contents documentation - Revise `toc` helper include to mention that it will be deprecated in the next major version. - Add documentation to `single` layout explaining how to enable table of contents on those pages. * Update CHANGELOG and history * Update LICENSE Close #1222
This commit is contained in:
@ -34,6 +34,14 @@ layout: default
|
||||
{% endunless %}
|
||||
|
||||
<section class="page__content" itemprop="text">
|
||||
{% if page.toc %}
|
||||
<aside class="sidebar__right">
|
||||
<nav class="toc">
|
||||
<header><h4 class="nav__title"><i class="fa fa-{{ page.toc_icon | default: 'file-text' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label }}</h4></header>
|
||||
{% include toc.html sanitize=true html=content h_min=2 h_max=3 class="toc__menu" %}
|
||||
</nav>
|
||||
</aside>
|
||||
{% endif %}
|
||||
{{ content }}
|
||||
{% if page.link %}<div><a href="{{ page.link }}" class="btn btn--primary">{{ site.data.ui-text[site.locale].ext_link_label | default: "Direct Link" }}</a></div>{% endif %}
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user