# 主题列表预览（旧版）

**URL:** https://meta.discourse.org/t/topic-list-previews-legacy/101646
**Category:** Plugin
**Tags:** deprecated
**Created:** [2018年十一月9日 03:56 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646 "2018-11-09T03:56:38Z")
**Posts on this page:** 20
**Page:** 7

<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: [2020年五月26日 20:11 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1063 "2020-05-26T20:11:57Z")

</div>

看起来可能有 JavaScript 错误？你能贴出任何控制台错误吗（忽略警告）？

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [2020年五月26日 20:27 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1064 "2020-05-26T20:27:22Z")

</div>

我就知道忘了点什么 😅

顺便一提，这几乎是原版，你的辅助插件、Akismet 和日历是仅有的插件

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/d/3dfdbc8ee1e1e1179a974b91f3d73f5272e7467d.png)

---

<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: [2020年五月26日 20:27 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1065 "2020-05-26T20:27:57Z")

</div>

Bingo，你没有按照说明操作 🙂 又是 🙂 你需要允许外部脚本。这与你之前报告的问题完全相同。👀

> [@Topic List Previews (legacy)](https://meta.discourse.org/t/topic-list-previews/101646/965?u=merefield):
>
> Yup a JavaScript error might well stop the layout code dead. Have you updated staging and Theme Component to latest? I trust you have TLP plugin uninstalled? Oh and have you given it rights to get the required scripts? Add this to security settings: content security policy script src: [https://unpkg.com](https://unpkg.com) This is no longer necessary, because Discourse’s funky new Theme Modifiers support modifications to CSP which is now implemented in the TC (that allows ImagesLoaded and dependencies to be d…

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [2020年五月26日 20:33 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1066 "2020-05-26T20:33:54Z")

</div>

哎呀！我完全忘了那件事，非常抱歉！我是根据这篇帖子来的，没记起那个小细节。一下子想做的太多啦：🤪

> [@Topic List Previews (legacy)](https://meta.discourse.org/t/topic-list-previews/101646/1010):
>
> OK I’d better summarise the current status as things are getting confusing: There are now two distinct setups: Existing, standard, Plugin based one. I’m thinking of replacing it with 2 though (I will give notice). [Plugin](https://github.com/paviliondev/discourse-topic-previews) https://github.com/paviliondev/discourse-topic-previews OR: TC based, experimental, expect minor issues but added bonuses of Featured Images on mobile and responsiveness to sidebars … optional plugin sidecar that adds features [Theme Component](https://github.com/merefield/discourse-topic-list-previews-theme) https://github.com/mere…

---

<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: [2020年五月26日 20:34 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1067 "2020-05-26T20:34:29Z")

</div>

别担心，帖子太多了，而且设置比我想要的要复杂一些。我有时会忘记。

~~@davidkingham 我已修改该帖子以添加该细节：+1：~~

不再需要，请见下文。

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2020年五月26日 20:44 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1068 "2020-05-26T20:44:51Z")

</div>

> [@merefield](#):
>
> 您需要允许外部脚本

@merefield 您可以通过将其添加到主题的 `about.json` 中，让用户跳过此步骤。

> [@david](#):
>
> - `csp_extensions` **字符串数组** - 向 CSP 添加指令。其功能与旧的“extend\_content\_security\_policy”主题设置方法相同

---

<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: [2020年五月26日 20:45 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1069 "2020-05-26T20:45:43Z")

</div>

太棒的建议了，David，谢谢，我会照做的！

---

<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: [2020年五月26日 21:10 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1070 "2020-05-26T21:10:59Z")

</div>

抱歉，David，另一位 David 已经为这个问题提供了一个出色的解决方案，我已经部署了它，所以你不再需要手动添加它了：slight\_smile: 为之前所有的设置折磨向你道歉：slight\_smile:

---

<div class="post-metadata">

### Author: ![Krischan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/krischan/32/47290_2.png) [@Krischan](https://meta.discourse.org/u/Krischan)
#### Post date: [2020年五月27日 14:40 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1071 "2020-05-27T14:40:56Z")

</div>

> [@merefield](#):
>
> 是的，那样可行。或许可以添加一个关于“最新”与“创建时间”的设置选项。

不想打扰，但这一点是否在下一个更新的范围内？感谢您的反馈！

---

<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: [2020年五月27日 14:43 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1072 "2020-05-27T14:43:52Z")

</div>

我无法提供时间线，但是的，我打算实施这一点。

---

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [2020年五月28日 09:16 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1073 "2020-05-28T09:16:52Z")

</div>

> 缩略图生成功能现已移至 Discourse 核心。TLP 之前用于创建缩略图的功能现在主要由 Discourse 完成。TLP 正逐渐变成一个展示层。

刚刚注意到，缩略图的 CDN 链接现在也能正常工作了，太棒了！😃

---

<div class="post-metadata">

### Author: ![raghukamath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raghukamath/32/160330_2.png) [@raghukamath](https://meta.discourse.org/u/raghukamath)
#### Post date: [2020年五月28日 09:36 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1074 "2020-05-28T09:36:53Z")

</div>

更新后，顶部行的特色图片缩略图没有显示。我需要做些什么吗？我只安装了原始的 TLP 插件。

---

<div class="post-metadata">

### Author: ![ozkn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ozkn/32/196013_2.png) [@ozkn](https://meta.discourse.org/u/ozkn)
#### Post date: [2020年五月28日 13:52 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1075 "2020-05-28T13:52:26Z")

</div>

你好 @merefield，

更新后，主题列表预览无法正常工作。

> [@Rebake all posts?](https://meta.discourse.org/t/rebake-all-posts/69340/2):
>
> Either one of these should work ./launcher enter app rake posts:rebake or cd /var/discourse ./launcher enter app bundle exec rake posts:rebake

我已经完成了重新烘焙（rebake）流程。

在移动设备上预览图片无法显示。

我使用的是 Amazon S3。这个问题是否与此有关？

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [2020年五月28日 16:59 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1076 "2020-05-28T16:59:40Z")

</div>

我刚刚将 Discourse 更新到最新版本，但我的网站上所有主题列表中的图片/缩略图都消失了。

这是 bug 吗？所有插件设置仍然正常/处于激活状态。“摘要”功能正常，但图片无法显示。

---

<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: [2020年五月28日 17:20 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1077 "2020-05-28T17:20:09Z")

</div>

各位，你们真是让我头疼……我们已发布政策，仅支持在每月前5天内进行升级。在其他时间自行升级的风险需自行承担。如果您希望我迅速响应，请 **不要** 在当月进行升级。

不过，我刚刚在我的网站上测试了该插件，已完全更新，缩略图生成正常。

请确保您使用的是官方仓库：`https://github.com/paviliondev/discourse-topic-previews`

并且已对所有帖子重新烘焙。请耐心等待处理过程，因为所有处理都需要时间，结果不会立即出现。

如果之后您仍未看到生成的缩略图并显示在 `/latest.json` 中，那很可能不是 TLP 的问题。

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [2020年五月28日 17:36 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1078 "2020-05-28T17:36:30Z")

</div>

我已将“下载远程图片的最大天数”修改为 3650 并重新烘焙，效果看起来不错：

cd /var/discourse  
./launcher enter app  
rake posts:rebake

---

<div class="post-metadata">

### Author: ![raghukamath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raghukamath/32/160330_2.png) [@raghukamath](https://meta.discourse.org/u/raghukamath)
#### Post date: [2020年五月28日 17:54 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1079 "2020-05-28T17:54:41Z")

</div>

> [@merefield](#):
>
> 各位，你们真是要把我逼疯了……我们已发布政策，仅在每月的前 5 天支持升级。

抱歉，无意惹您生气。感谢您提醒我们关于更新政策的事宜。

---

<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: [2020年五月28日 18:27 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1080 "2020-05-28T18:27:54Z")

</div>

别担心。TLP 如今已是一个庞大的软件，维护工作相当繁重。Pavilion 的其他几个插件也是如此，因此我们正努力将支持集中在第 1 至第 5 天，以便在其他时间处理其他优先事项。除非您拥有用于预检查的测试服务器，否则如果您依赖我们的插件，请避免在这一时段之外升级生产环境 :)。

如果这能促使您搭建测试服务器，我将非常高兴 🙂

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年五月28日 23:12 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1081 "2020-05-28T23:12:07Z")

</div>

仅供参考，我刚刚进行了一次升级，但引导过程失败了。

我在 `app.yml` 中的 `params` 下方添加了以下内容（那里已有一个被注释掉的版本）。添加后，系统成功引导并启动，目前看来运行正常。

```plaintext
  version: 1a5bcf2a648caf3d277ae2b0856a566789c55e3f

```

---

<div class="post-metadata">

### Author: ![Raj\_Rathore](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raj_rathore/32/155320_2.png) [@Raj\_Rathore](https://meta.discourse.org/u/Raj_Rathore)
#### Post date: [2020年五月29日 04:02 UTC](https://meta.discourse.org/t/topic-list-previews-legacy/101646/1082 "2020-05-29T04:02:39Z")

</div>

> [@merefield](#):
>
> 不用担心。TLP 现在是一个庞大的软件，维护起来相当复杂。Pavilion 的其他几个插件也是如此，因此我们正尝试将支持集中在每月的 1 日至 5 日，以便在其他时间处理其他优先事项。除非您有用于预检查的暂存服务器，否则如果您依赖我们的插件，请避免在此时间段之外升级生产环境。🙂

您能否仅提取选择缩略图/特色图片的功能，并将其创建为一个独立的主题组件？我只需要这个功能。如果 Discourse 能包含此功能那就太好了。您实现的选择缩略图功能非常直观 👍 我正在使用一个 Fakebook 主题（我将其重命名为 Social :)），但瀑布流布局似乎不太适合它，使用此主题组件还会限制滚动行为……并破坏布局。不过，此主题唯一需要的功能就是选择缩略图。其他主题都已包含您的主题组件。希望您能尽快解决所有问题，不过主题组件看起来很不错……正如我学到的那样，我会在每月的头 5 天更新 Pavilion 主题/插件。🙂

[上一頁](https://meta.discourse.org/t/topic-list-previews-legacy/101646.md?page=6)

[下一頁](https://meta.discourse.org/t/topic-list-previews-legacy/101646.md?page=8)
