Automatically generate a table of contents in Jekyll.
See an example page.
Read about the details.
Add
- _includes/toc.html
- js/toc.js
- js/jquery-3.1.1.slim.min.js (optional)
to your site.
Generate a toc for your page with
{% include toc.html %}
tags
: Specify which tags to generate links for. eg:{% include toc.html tags="H2,H3" %}
ignore
: Ignore any tag matched by a jQuery selector. eg:{% include toc.html ignore="#sections" %}