话题列表摘要

:discourse2: Summary Topic List Excerpts allows you to enable excerpts for unpinned topics (by default, Discourse only displays topic excerpts for pinned topics).
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-topic-excerpts
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

Works great alongside Topic List Thumbnails in “list” mode!

:information_source: The excerpts themselves are generated by Discourse Core, using the same logic as the excerpts of ‘pinned’ topics. If you have a query / suggestion about how the excerpts are built, please make a new support topic.


:bulb: Tip: you can keep line breaks in excerpts by adding this CSS to your theme:

.topic-list .topic-excerpt {
    white-space: pre-line;
}

Be aware that results may look off depending on the posts’ contents.

Settings

Name Description
show excerpts mobile
show excerpts desktop
enabled categories Enable excerpts in specific categories. Leave both categories and tags blank to show excerpts on all routes
enabled tags Enable excerpts in specific tags. Leave both categories and tags blank to show excerpts on all routes.

:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

Last edited by @JammyDodger 2024-06-15T19:28:50Z

Check documentPerform check on document:
47 个赞

Great, a blog-like topic listing (together with Topic List Thumbnails Component)! :clap:

Can it be restricted by category like the other component?

7 个赞

Sure, I just added a category setting:

https://github.com/discourse/discourse-topic-excerpts/commit/aed85ba07007d38fe98de8889e3b155c69aeb812

13 个赞

Thanks, much appreciated.

I also take the chance to report that there is some kind of incompatibility with the Topic Thumbnails component, since the images appear twice for each topic in the topic list (topic list option on thumbnails component + topic excerpts component).

2 个赞

You’re right, sorry about that. Should be fixed now

9 个赞

Love this component; thank you! Is there any way to adjust the word/character length of the excerpts displayed in topic lists? (Never mind, I found the topic excerpt maxlength site setting, adjusted it, and rebuilt HTML for the topic posts in question.)

3 个赞

分类设置有效,但标签设置在最新的 discourse 中无效。

2 个赞

@th21 标签处理现已修复——抱歉耽搁了!

3 个赞

帖子已拆分为新主题:仅在 /latest 上为某些类别显示摘录

帖子已拆分为新主题:使用不同颜色区分主题列表行中的内容

您好,为什么我的网站上的“阅读更多”是灰色的,而您的网站上是蓝色的,我该如何更改颜色?

1 个赞

您可以使用 CSS 进行自定义。

例如,使用链接的预定义颜色。不过,您可以提供想要的 颜色

.topic-excerpt-more {
    color: var(--tertiary);
}
1 个赞

您好,此组件呈现在 discourse 文档插件页面上,并使摘录可点击至 discourse 讨论的 URL,而不是文档的 URL,有什么方法可以避免这种情况发生吗?

您好,可以显示最新帖子而不是第一篇帖子吗?

2 个赞

我有一个插件+主题组件,用于:Topic List Latest-Post Excerpt

2 个赞

桌面版主题组件有问题?

启用它时,头像显示如下:

我今天更新了我的 Discourse

编辑:有没有办法限制摘录的行数/字符数?

2 个赞

是的,我也是。

最新情况是,当我注销时一切正常,但当启用 discourse-right-sidebar-blocks 时,其他路由会出现这种情况。

Excerpt 的切换按钮在手机上不可见。是设计如此,还是我问得太早了?

我喜欢这个!有什么方法可以阻止摘录显示在私人消息中吗?

我试过这个组件,它在个人消息中不显示摘要。:thinking: