Jekyll Toc screenshot

Jekyll Toc

Author Avatar Theme by Allejo
Updated: 15 Jan 2024
506 Stars

A GitHub Pages compatible Table of Contents generator without a plugin or JavaScript :octocat:

Overview:

The Jekyll Pure Liquid Table of Contents is a solution that allows users to generate a table of contents for their Jekyll websites without using JavaScript or custom Jekyll plug-ins. This solution is written entirely in Liquid and can be easily included in any website layout. It offers a customizable snippet that can be tailored to fit the specific needs of the user.

Features:

  • Generates table of contents using Liquid instead of JavaScript or custom Jekyll plug-ins.
  • Can be used as an {% include %} in any website layout.
  • Customizable parameters such as HTML, sanitization, CSS class, ID, TOC header level minimum and maximum, output as ordered or unordered list, and custom class for each list item.

Installation:

To install the Jekyll Pure Liquid Table of Contents, follow these steps:

  1. Download the toc.html file from the latest release or the master branch.
  2. Place the downloaded file in your _includes folder.
  3. In your website’s template layout, where you have {{/* content */}}, use the following liquid tag to render the HTML from the markdown source: {% include toc.html %}.

Summary:

The Jekyll Pure Liquid Table of Contents provides a convenient and efficient solution for generating table of contents in Jekyll websites. Unlike other options that rely on JavaScript or custom plug-ins, this solution is written entirely in Liquid and can be easily included in any website layout. With its customizable parameters, users can tailor the table of contents to meet their specific needs. Overall, this tool offers a seamless way to enhance website navigation and improve user experience.