# 为目录生成加入返回顶部功能

**URL:** https://meta.discourse.org/t/include-scroll-to-top-affordance-in-table-of-contents-generation/292078
**Category:** Feature
**Tags:** disco-toc
**Created:** [2024年一月18日 13:33 UTC](https://meta.discourse.org/t/include-scroll-to-top-affordance-in-table-of-contents-generation/292078 "2024-01-18T13:33:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![craigconstantine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/craigconstantine/32/511195_2.png) [@craigconstantine](https://meta.discourse.org/u/craigconstantine)
#### Post date: [2024年一月18日 13:33 UTC](https://meta.discourse.org/t/include-scroll-to-top-affordance-in-table-of-contents-generation/292078/1 "2024-01-18T13:33:59Z")

</div>

# 滚动到顶部导航

能否让目录（TOC）自动包含一个“带顶栏的向上箭头”？……就像用于滚动到底部的“带底栏的向下箭头”一样。

# 为什么？

为了实现“滚动到顶部”的功能，我在预期出现目录的主题的最开头包含了一个 H1 标题。

不幸的是，这个 H1 通常与主题标题相同——或非常相似。因此，它看起来多余且重复。像这样……

 ![Screenshot 2024-01-18 at 08.16.39](https://global.discourse-cdn.com/meta/original/4X/a/7/3/a7372ca95ac29f49f3f9fcef3fa8454c0bc959a7.png)

这意味着主题列表中的主题摘要文本似乎会“卡顿”，因为摘要以（看起来像是）标题开头。此外，它还会占用摘要字符数。像这样……

 ![Screenshot 2024-01-18 at 08.30.27](https://global.discourse-cdn.com/meta/original/4X/0/8/c/08c4c871c342ebb8fd21780f3943bacdba726cb2.png)
