Repository navigation
Releases: aidanashby/wp-toc-block
Releases · aidanashby/wp-toc-block
Release list
v0.1.1
- Plugin icon on the Plugins and Updates screens.
- Bundled Plugin Update Checker updated from 5.6 to 5.7.
Full Changelog: v0.1.0...v0.1.1
v0.1.0
Initial release. Built for Divi 5.
A [toc] shortcode that builds a nested table of contents from the headings in your post content. No auto-insertion — you place the shortcode where you want it.
Highlights
- Settings page covering which container holds the post content, minimum headings/words, heading levels, label, colours, list markers, size scale, indent, line height and item spacing.
- Optional collapsible toggle: the whole top of the block expands and collapses it, as a real button, with width and height animating together and a rotating chevron. Honours
prefers-reduced-motion. - Alignment left/right/centre, with an optional float so content flows around the block. Never floats at 767px and below.
- Scroll offset so a clicked link doesn't land the heading under a fixed header bar — applied as
scroll-margin-top, so it also covers direct#hashlinks and browser back/forward. - Adds anchor IDs to headings that lack them, without colliding with existing IDs.
- Outputs
ItemListschema.org JSON-LD. - Self-updates from GitHub releases.
Note on the approach
The list is built in the browser rather than in PHP. Divi 5 assembles its module tree through its own pipeline and never passes the finished HTML back through WordPress's the_content filter, so no server-side filter reliably sees the rendered markup. See the README for the full reasoning and trade-offs.