Skip to content

InPoint-Automation/StickySidebarTOC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sticky Sidebar TOC

Icon

Description

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.

Features

  • 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

Requirements

Publii 0.43.0 or newer. The active theme must render an inline table of contents (.post__toc).

Installation

  1. Download the release ZIP.
  2. Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
  3. Enable the plugin for the site.

Usage

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; 0 auto-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.

screenshot

Contributing

Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.

Licenses

Main code

This project is licensed under the GPLv3+. See LICENSE file for details.

Third-Party Components

None, the plugin is self-contained plain JavaScript with no dependencies.

Credits

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.

Changelog

See CHANGELOG.md for the full version history.

About

A Publii plugin that clones an inline table of contents into a fixed sidebar while scrolling.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors