使用标题列表总结您的帖子。向标题区块添加 HTML 锚点以在此处链接它们。
- 名称:
core/table-of-contents - 类别: design
- API 版本: 3
- 区块类型: Dynamic (server-rendered)
- 关键词:
document outline,summary
属性
通过 block.json 中的 attributes 属性定义。
| 属性 | 类型 | 默认 | 描述 |
|---|---|---|---|
headings | array | [] | 角色: local |
onlyIncludeCurrentPage | boolean | false | — |
maxLevel | number | — | — |
ordered | boolean | true | — |
支持
通过 block.json 中的 supports 属性定义。
anchor:trueariaLabel:truehtml:falsebackground:backgroundImage:truebackgroundSize:truegradient:true
color:text:truebackground:truegradients:truelink:true
shadow:truespacing:margin:truepadding:true
typography:fontSize:truelineHeight:truetextAlign:true
interactivity:clientNavigation:true
区块标记
这是一个 动态区块。它在服务器上渲染,不会在帖子内容中保存 HTML。
在帖子内容中,它存储为区块注释:
<!-- wp:table-of-contents {"maxLevel":3,"ordered":false} /-->
来源
- block.json (参考)
- 源代码目录 — 浏览
edit和save源文件,index.php等。