Sticky Sidebar TOC is a Publii plugin that clones an inline table of contents into a fixed sidebar while scrolling.
On viewports too narrow for a sidebar it switches automatically to a slide-out mobile panel with a toggle button.
The plugin depends on the theme already rendering an inline table of contents (Publii's TOC block).
All visual styling is inherited from the theme's own TOC and it does not generate TOC content itself.
- Clones the inline table of contents into a fixed sidebar
- Scroll highlights the current section in the sidebar and mobile panel
- Smooth-scroll navigation when a TOC link is clicked
- Slide-out mobile panel with a left-edge toggle on narrow screens
- Auto-positions in the gap between content and viewport edge
- Inherits all TOC styling from your theme
- Tested with the Simple and Massively themes
- Configurable top offset, left position, opaque background, theme layout, and apply-to scope
Publii 0.43.0 or newer. The active theme must render an inline table of contents (.post__toc).
- Download the release ZIP.
- Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
- Enable the plugin for the site.
Open Plugins -> Sticky Sidebar TOC -> settings icon:
- Top offset (rem): distance from the top of the viewport; match your sticky header height.
- Left position (px): fixed left position;
0auto-centers the sidebar in the content gap. - Opaque background: adds a solid background behind the sidebar (enable on sites with background images).
- Theme layout: Simple (
.entry-wrapper) or Massively (#main) so the sidebar measures the correct content area. - Apply to: posts, pages, or both.
Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.
This project is licensed under the GPLv3+. See LICENSE file for details.
None, the plugin is self-contained plain JavaScript with no dependencies.
This project was developed by InPoint Automation Sp. z o.o. https://inpointautomation.com/
Thanks to the Publii project for the CMS and plugin API.
See CHANGELOG.md for the full version history.
