Skip to content

Releases: aidanashby/wp-toc-block

Release list

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 28 Sep 21:35
  • 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

Choose a tag to compare

@aidanashby aidanashby released this 11 Sep 15:57

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 #hash links and browser back/forward.
  • Adds anchor IDs to headings that lack them, without colliding with existing IDs.
  • Outputs ItemList schema.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.