新闻插件 📰

Follow the steps here and pull from this link GitHub - paviliondev/discourse-news: Adds a news stream to your Discourse instance

2 个赞

Is it possible to add multiple feeds from different sources. It seems like we can add only one XML from only one source.

2 个赞

Hey @Pravi, thanks for using the plugin.

No, it is not currently possible to add multiple feeds.

1 个赞

Any future update on multiple feeds?

2 个赞

Hi,

I’ve got the Pavilion News plugin in my new discourse install - and I’m testing it out with posts and users and have run into a number of issues that I’m wondering if other News plugin users might have found a work around for?

Load times for home page?
Is there any way to control the number of news posts that are initially downloaded when a person, anonymous user comes to the site? It seems that it downloads the entire news section (every single post) at once - which seems crazy. As I’ve added News items to fill up the site a bit, load times for the home page have dramatically increased. When I just had a post or two load times were in the 200 ms range - but now with 10 or 15 posts the load time is up to 1500ms.

Stripped out images from the news posts?
Other than the top most image, any images that are in the post seem to be stripped out of the post so that when people read the /news feed the can’t see any of the images that the text in the body refers to. Very strange…

Embedded Videos - Don’t play, replaced by static image, with link to YouTube - thus side-stepping the embedded video ability. Takes the people off the site - which basically remove a feature from discourse.

Any suggestions appreciated!

2 个赞

Sorry, this isn’t a solution, but those should just lazy load and show a static image before playing.

2 个赞

The basic concept here is that the News Plugin sits at and enhances a Topic List view of either a list of topics or RSS feed.

Thus the “per-Topic” view is simpler than a single Topic view would be expected to be, but richer than the default, image-less “venetian blind” format of a regular Discourse Topic List.

This is expected and a practical compromise.

  • the plugin’s primary focus is RSS feeds and supports one featured image per “post”, however, it can also show an image from a Discourse Topic.

  • If you want to see the other images you can navigate to the full Topic.

  • this is partly to ensure performance is reasonable. To show all images from all Topics would be a large download.

  • This also keeps the layout more compact.

  • Same goes for embedded videos on Topics, these are just presented as a thumbnail on the news feed, just like they would be on all equivalent plugins and theme components that display on the Topic List.

Is this for RSS or Discourse Category based feeds? If the latter there may be some performance enhancement potential by sourcing a low resolution thumbnail instead of the full sized image and applying lazy loading … however given the size of the laid out image a low resolution image might not cut the mustard.

If your interest is not in RSS feeds then you might also want to check out Topic List Previews TC which is a bit more optimised for that task, but has a different flavour of layout.

1 个赞

Hi Rober - thanks for the explanation. This is not for an rss type application - this is for more of a blog + forum application. I wanted to avoid the hassles and overhead of having both a Wordpress site and the discourse forum since its a small side project for me.

How do you apply “lazy loading” - I’m not a coder, and not familiar with that setting.

Thanks for your info.

2 个赞

That’s a feature request.

1 个赞

You can’t. But it is a feature that should be in use nowadays anyway. So, hopefully devs of Discourse come to modern time :wink:

(No, I don’t know how difficult it would be, but nearly every other platforms use it, and for reason)

2 个赞

Actually, it’s a fairly trivial change that doesn’t need to involve the Discourse team, which I’ve gone ahead and made:

IMPROVE: rename raw templates and add lazy loading for thumbnail · paviliondev/discourse-news@6150851 (github.com)

I’ve also deployed a set of fixes for breaking changes and modernised the template suffixes:

COMPATIBILITY: settings references · paviliondev/discourse-news@dcda6a7 (github.com)

@angus

5 个赞

您好,我刚安装了插件,这是一个运行默认主题的新网站。图片在手机和桌面上都超出了屏幕。有什么解决办法吗?

1 个赞

嘿,你能分享一下你的“话语新闻来源”是什么吗?如果它是一个分类,那么图片按预期工作(见此处)。

如果它是一个 RSS 提要,图片支持将取决于提要的版本。如果是 RSS 1.x,RSS 1.x 规范中没有官方的图片支持,因此插件不支持这些提要中的图片。

如果是 RSS 2.0,那么图片支持通过 enclosure 标签提供。提要项需要一个类似这样的属性:

<enclosure url="http://feed.com/image.jpg" length="12345" type="image/jpeg"/>

进一步了解:

2 个赞

您好。是的,就是这个订阅链接

1 个赞

好消息是该 Feed 是 RSS 2.0,并且确实在 enclosure 标签中有图片。因此,它们会按预期显示。

我已将该 Feed 加载到 try.thepavilion.io/news 作为示例。请确保您具有以下站点设置:

  • discourse news enabled: true
  • discourse news source: RSS
  • discourse news rss: https://cointelegraph.com/rss/tag/altcoin

1 个赞

是否可以将帖子标记为“新闻”,以便新闻来自某个主题中的特定帖子?

更好的解释:在我们的论坛中,会员会定期发布新闻,我想将新闻标签应用于该帖子以使其成为新闻。

1 个赞

该插件目前支持使用类别作为新闻来源,但不支持标签。

2 个赞

谨此指出,标签并非帖子的概念,而是主题级别的,因此您所要求的在任何情况下都具有挑战性。

2 个赞

我输入的时候就在想……

除了帖子的 ID,有没有办法识别帖子来提取这些帖子?

1 个赞

我已启用这些设置。并且也启用了默认主题和主题预览插件。我看到的是这样。

1 个赞