Page 7 of 10 | View as a single page

Table Of Contents (TOC)

JPC automatically generates a Table of Contents for you. To use this from within your content, simply insert the following:

  {{ paginator.toc.simple }}

If you want to use this from an HTML layout, e.g. an included sidebar.html:

  {{ paginator.toc.simple | markdownify }}

The difference between this and the one built into kramdown, the default Jekyll Markdown engine, is that it is aware that content may be split across several pages now, and adjusts links depending on the current page.

The reason paginator.toc.simple is used vs just paginator.toc is to allow for further TOC features in the future.

Excluding sections

Should you want some sections excluded from the Table Of Contents, add them to the toc_exclude option in your site configuration or content front-matter:

paginate_content:
  toc_exclude: "Table Of Contents"

or

paginate_content:
  toc_exclude: 
    - "Table Of Contents"
    - "Shy Section"

The generated section ids follow the usual convention:

  1. Convert the section name to lowercase
  2. Remove all punctuation
  3. Convert multiple spaces to a single space
  4. Convert spaces to dashes
  5. If that id already exists, add “-1”, “-2”, etc. until the id is unique
5 6 7 8 9