
Liquid filter to generate Table of Content into Jekyll pages
The Jekyll TOC Generator is a powerful Liquid filter that enhances Jekyll pages by automatically generating a Table of Contents (TOC). This feature is particularly useful for lengthy documentation or articles, as it provides readers with a clear navigation path without the need for manual updates. By integrating this tool into your Jekyll site, you can ensure a more organized and user-friendly experience for your audience.
Setting it up is straightforward, requiring only the addition of a couple of files to your project. Once installed, this filter can dynamically create HTML code from your markdown headers, turning them into an interactive TOC that enhances your site's usability.
Easy Installation: Simply copy the tocGenerator.rb file into your _plugins directory and include the necessary CSS for styling.
Dynamic TOC Generation: Automatically generates a Table of Contents from H1 and H2 headers in your markdown files, allowing for seamless navigation.
Customization Options: You can easily adjust settings in your _config.yml file or disable TOC generation for specific pages using the noToc: true directive.
CSS Styling: A default CSS implementation is provided for styling your TOC, ensuring it displays correctly and is visually appealing.
jQuery Integration: The included jQuery plugin allows for toggle functionality, enhancing user interaction with the TOC.
MediaWiki Compatibility: The styling is compatible with MediaWiki themes, making it versatile for various site designs.
Fallback for GitHub Pages: For users hosting on GitHub, where plugins aren't supported, a full JavaScript solution is available as an alternative for TOC generation.
With these features, the Jekyll TOC Generator offers an exceptional solution for anyone looking to enhance their Jekyll documentation or blog with organized navigation.
