跳到内容

Axismundi Table of Contents

v0.1.2

Jiwoon Kim · 2026年7月18日 上架

On-page table of contents block that builds from a post's headings and keeps the heading ids in sync.

正在使用
10 以下
评分
暂无
累计下载
292
最近更新
2026年7月19日
需要 WordPress 6.7+已测试到 7.0.9PHP 8.1+

贡献者

Axismundi Table of Contents provides the axismundi/toc block: a dynamic,
server-rendered list built from the current post’s headings, with a scroll-spy
that marks the section you are reading.

The block render and a render_block_core/post-content filter share one
deterministic slug function, so the table-of-contents anchors always match the
heading ids — regardless of render order or where you place the block (a template
aside or inside the content). Author-provided HTML anchors are respected, and
duplicate headings are de-duplicated (-2, -3).

  • Two placements: a sidebar rail, or a collapsible disclosure above the
    content (a native <details> whose summary can echo the current
    section). A “Table of contents (above content)” pattern ships the disclosure
    ready to drop before the post content.
  • Builds from h2–h4 by default (configurable per block).
  • Unordered list by default; switch to a numbered (ordered) list per block.
  • Emits the shared toc-list / toc-h2…h4 / is-current class vocabulary so a
    theme’s table-of-contents skin couples for free; ships a Material Design 3
    token skin (with fallbacks) in the meantime.
  • Scroll-spy marks the current heading and clears when you leave the content
    (above the first heading or past the post content).

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums