Supplyist TOC Block

外掛說明

Add the Table of Contents Block anywhere in your Gutenberg editor. It scans H2–H6 headings in the post content and builds a nested, clickable table of contents. Links automatically work by adding IDs to headings.

No configuration needed. Works on single posts and pages (not archives or category listings).

  • No theme editing required
    You can activate the plugin on any site.
  • Compatible with Gutenberg / Classic Editor
    It processes the final rendered HTML.
  • SEO-friendly
    IDs are based on sanitize_title(), the same function WP uses for slugs.
  • Works with headings that already have IDs
    It does not overwrite existing IDs.

Example:
– Structure Your Content – Write your post or page using semantic headings (H2, H3, etc.)—just like you normally would.
– Insert the Table of Contents Block – Add the “Table of Contents Block” anywhere in your editor (e.g., right after the introduction).
– Let It Work Automatically – The plugin scans your headings, builds a hierarchical, scroll-linked table of contents in real time, and updates dynamically as you edit.

Key Features

  • Server-side generated Table of Contents
  • Automatically detects H2–H6 headings
  • Generates nested lists based on heading hierarchy
  • Automatically adds IDs to headings when missing
  • Lightweight and simple
  • Useful for:
    • Adding a Table of Contents to a post or page
    • Generating heading IDs
    • Linking to sections within content

Why use this plugin?

  • Smart Parsing: Supports H2 through H6 headings
  • Clean Output: Uses standard HTML lists for maximum theme compatibility
  • Non-intrusive: Does not modify existing heading IDs
  • Lightweight & Fast

螢幕擷圖

  • Screenshot of the block in editor.
  • Example of a generated “Table of Contents”.

適用於區塊編輯器

這個外掛提供 1 個可供 Gutenberg/區塊編輯器使用的區塊。

  • Ctb Custom Toc

安裝方式

  1. Upload the plugin files to /wp-content/plugins/supplyist-toc-block/, or install directly from the WordPress plugin directory.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Add the “Custom Table of Contents” block anywhere in your editor.

常見問題集

How does “Supplyist TOC Block” generate a Table of Contents?

The plugin scans your headings and builds a hierarchical, scroll-linked table of contents on the front end.

Does this conflict with SEO plugins?

If you already use SEO plugins, those may also output Table of Contents. You should avoid duplication.

How does “heading ID insertion” work?

  1. Scans the content after it is loaded.
  2. Detects all H2, H3, H4, H5, and H6 headings.
  3. Generates a slug (URL-friendly string).
  4. Inserts it as the heading’s id=”” attribute.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Supplyist TOC Block〉的開發相關工作。

參與者

將〈Supplyist TOC Block〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0.0

  • Initial release.