# 主题列表预览（TLP）

**URL:** https://meta.discourse.org/t/topic-list-previews-tlp/209973
**Category:** Theme component
**Created:** [2021年十一月23日 12:25 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973 "2021-11-23T12:25:59Z")
**Posts on this page:** 20
**Page:** 35

<div class="post-metadata">

### Author: ![lhkjacky](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhkjacky/32/204198_2.png) [@lhkjacky](https://meta.discourse.org/u/lhkjacky)
#### Post date: [2025年十月21日 06:37 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/697 "2025-10-21T06:37:29Z")

</div>

感谢您的快速回复。 👍 💯

经过数小时的调试 😅 ，我终于发现错误是由以下设置引起的。

`Prevent anons from downloading files`  
`Prevent anonymous users from downloading attachments.`

启用此设置时会发生错误。

 ![2025-10-21_143213](https://global.discourse-cdn.com/meta/original/4X/0/b/2/0b259662fc4047a60b799fbfc214e96f69c17cbe.jpeg)

Topic List Previews 从 /uploads/default/original/1X/d8ce366bd7aad8f9fc7b26b08aecc855dd6d425c.js 动态加载的 imagesloaded.js 文件，在启用“Prevent anons from downloading files”设置时被匿名用户阻止。  
因此，浏览器未能加载脚本，导致 TLP 中的 preview-edits.gjs 组件在未登录访问者处出现故障。

当我恢复到默认设置时，错误立即消失。

 ![2025-10-21_143155](https://global.discourse-cdn.com/meta/original/4X/7/1/b/71be51f5d667fc50fadaa6cc2237c095cb2075af.jpeg)

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2025年十月21日 06:55 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/698 "2025-10-21T06:55:09Z")

</div>

知道了，谢谢！

---

<div class="post-metadata">

### Author: ![Eviepayne](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviepayne/32/352733_2.png) [@Eviepayne](https://meta.discourse.org/u/Eviepayne)
#### Post date: [2025年十一月4日 01:14 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/699 "2025-11-04T01:14:54Z")

</div>

我想指出，我通过不更新而是删除 `app.yml` 中仍然存在的旧插件（这些插件已捆绑在 discourse core 中）来解决了这个问题。  
删除这些插件还修复了许多其他问题，因此如果有人遇到奇怪的随机问题，他们应该删除这些插件。

---

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [2025年十一月28日 09:11 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/700 "2025-11-28T09:11:43Z")

</div>

您好 @merefield，希望您一切都好！😊

您能帮我理解一下设置 `topic_list_tiles_larger_featured_tiles` 是做什么用的，以及它正常工作时应该是什么样子吗？  
非常感谢！

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2025年十一月28日 11:30 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/701 "2025-11-28T11:30:22Z")

</div>

它只是使该图块占据两列而不是一列（高度也加倍），这样您就可以在布局中突出显示特定主题。

不幸的是，该设置目前已损坏。我怀疑自从主题列表更改所需的大规模重写以来它就已损坏，而我只是错过了它。我有一个[修复它的分支](https://github.com/merefield/discourse-tc-topic-list-previews/tree/css_masonry)，但该工作依赖于[CSS 砌体发布](https://www.w3.org/blog/CSS/2025/09/18/masonry-update-issues/)，我们仍在等待。

无论如何，我最终可能会在当前系统下修复它。欢迎提交拉取请求 (PR)。

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [2025年十二月14日 20:53 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/702 "2025-12-14T20:53:51Z")

</div>

您好！我被引导到这个组件，因为我正在寻找一个解决方案来“扩展”我的主题内容，使其更像 Facebook/博客，即可以向下滚动的帖子流。我已经安装了它，可以看到我的预览，这很酷！我想知道是否有某个设置可以控制预览的长度（我想让它更长）。谢谢！

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2025年十二月14日 20:55 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/703 "2025-12-14T20:55:36Z")

</div>

我认为长度取决于 `Topic excerpt maxlength` 站点设置。

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [2025年十二月15日 16:53 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/704 "2025-12-15T16:53:53Z")

</div>

> [@Moin](#):
>
> 我认为长度取决于 `Topic excerpt maxlength` 站点设置。

试过了，但似乎不是那个 😥

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2025年十二月15日 17:00 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/705 "2025-12-15T17:00:46Z")

</div>

您是如何尝试的？您只是更改了设置吗？更改设置后您创建了新主题了吗？您触发了现有摘录的重新生成吗？

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2025年十二月15日 17:30 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/706 "2025-12-15T17:30:01Z")

</div>

如果您是自托管用户，可以安装侧载插件（参见 OP）并在插件中更新 `topic_list_excerpt_length`，这将覆盖核心设置。

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [2025年十二月15日 18:32 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/707 "2025-12-15T18:32:12Z")

</div>

> [@Moin](#):
>
> 你是如何尝试的？你只更改了设置吗？更改设置后你创建了新主题吗？你触发了现有摘要的重新生成吗？

我只是更改了设置……不，我没有创建新主题，也不知道触发现有摘要的重新生成是一回事 🥴

> [@merefield](#):
>
> 如果你是自托管的，你可以安装 sidecar 插件（参见 OP）并在插件中更新 `topic_list_excerpt_length`，这将覆盖核心设置。

谢谢，我是自托管的。覆盖（override）是做什么的？（我需要弄清楚如何安装插件……我看到有一个指南，但目前我的精力不允许我深入研究，很遗憾！）

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [2025年十二月16日 08:00 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/708 "2025-12-16T08:00:04Z")

</div>

> [@stephtara](#):
>
> 我需要弄清楚如何安装插件……我看到了有一个指南，但鉴于我现在可用的精力，它看起来太复杂了，很遗憾！

没那么糟！只需将仓库 URL 添加到 `app.yml` 并重建即可。

> [@Discourse](#):
>
> 将插件的仓库 URL 添加到容器的 `app.yml` 文件中：
> 
> ```plaintext
> hooks:
> after_code:
> - exec:
> cd: $home/plugins
> cmd:
> - sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git
> - sudo -E -u discourse git clone https://github.com/discourse/discourse-solved.git
> 
> ```
> 
> 将插件的 `git clone` URL 添加到包含 `git clone https://github.com/discourse/docker_manager.git` 的行的正下方）

> [@Discourse](#):
>
> 重建容器：
> 
> ```plaintext
> cd /var/discourse
> ./launcher rebuild app
> 
> ```

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [2025年十二月16日 09:56 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/709 "2025-12-16T09:56:55Z")

</div>

是的，但为此我需要爬到服务器上，我还没有这样做，因为一位友好的极客帮我做了初始安装。这在我能力范围内，但我需要先找出我的访问代码并找到进入的方法……

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [2026年一月3日 13:23 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/710 "2026-01-03T13:23:59Z")

</div>

> [@stephtara](#):
>
> > [@Moin](#):
> >
> > 你是如何尝试的？你只更改了设置吗？更改设置后你创建了新主题吗？你触发了现有摘录的重新生成吗？
> 
> 我只是更改了设置……不，我没有创建新主题，也不知道触发现有摘录的重新生成是回事 🥴

如何触发主题重新生成？

（另外，一个可能离题的附带问题：如果我知道一个设置的名称，比如 @Moin 在这里给我的那个，除了在管理员界面中搜索/查找它之外，有没有一个简单的方法来“设置”它？）

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2026年一月3日 13:43 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/711 "2026-01-03T13:43:03Z")

</div>

> [@stephtara](#):
>
> 如何触发主题重新生成？

那么它对新主题有效吗？  
我认为你需要重新烘焙旧帖子：

> [@How to change the length of existing excerpts?](https://meta.discourse.org/t/how-to-change-the-length-of-existing-excerpts/278722/2):
>
> Yup - you just need to rebake the posts: $ cd /var/discourse $ ./launcher enter app $ rake posts:rebake

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [2026年一月3日 13:52 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/712 "2026-01-03T13:52:31Z")

</div>

> [@Moin](#):
>
> 那么它对新主题有效吗？  
> 我想你需要重新烘焙旧帖子：

是的，对新帖子有效！终于做了一个😅  
“重新烘焙”——我理解的是，这只能从服务器端完成，而不能通过管理界面完成？

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2026年一月3日 14:37 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/713 "2026-01-03T14:37:11Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/7/1/0/7105a871d5aee4b358f6814f9b9a1458b094a75c.png)

针对单个主题，或者您需要使用命令行界面 (CLI) 和 rake 任务。

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2026年一月3日 14:39 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/714 "2026-01-03T14:39:55Z")

</div>

我认为您也可以使用“重建 HTML”按钮。

 ![Screenshot_20260103_152842_Firefox](https://global.discourse-cdn.com/meta/original/4X/9/2/3/923ea82268ce7ada88e836150e8d867b97e3a1f7.jpeg)  
我上次发帖时没有建议这样做，因为我当时试用时感觉它不起作用，但现在摘录的长度已经改变了，所以我想变化需要一段时间才能显示出来。

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2026年一月3日 14:51 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/715 "2026-01-03T14:51:31Z")

</div>

如果您将其与插件结合使用，则摘录会被缓存，但如果更改了插件设置，缓存键也会随之更改。

---

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [2026年一月14日 06:00 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/716 "2026-01-14T06:00:36Z")

</div>

您好，

我注意到 **主题列表磁贴标签 (Topic list tiles tags)** 和 **主题列表缩略图标签 (Topic list thumbnails tags)** 功能似乎已损坏。

它们不再按预期工作——对标签的更改不会影响我论坛上的主题列表显示。

[上一頁](https://meta.discourse.org/t/topic-list-previews-tlp/209973.md?page=34)

[下一頁](https://meta.discourse.org/t/topic-list-previews-tlp/209973.md?page=36)
