Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add public-url parameter to rss widget feeds #322

Open
wants to merge 1 commit into
base: release/v0.7.0
Choose a base branch
from

Conversation

JeckDev
Copy link
Contributor

@JeckDev JeckDev commented Jan 23, 2025

The rss feed widget shows a feed source which links directly to the feed url. You can find the link I'm referring to underneath each rss item's title, to the right of the "X hours ago" notice. Clicking that link in my browser downloads the rss.xml file, which is not preferred behavior.

This provides an optional parameter public-url which can be set per feed to override this behavior.

@JeckDev
Copy link
Contributor Author

JeckDev commented Jan 23, 2025

In the future, it may be worth changing current default behavior (link to the feed url) with a link to the feed's base url ("www.example.com" instead of "www.example.com/feeds/example-feed.xml").

I've left the default behavior unchanged here. One point against changing things, I do think some RSS feeds may include a style element which makes viewing the feed xml in browser more palatable, but I don't know any offhand to test.

Copy link
Member

@svilenmarkov svilenmarkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!

In the future, it may be worth changing current default behavior (link to the feed url) with a link to the feed's base url ("www.example.com" instead of "www.example.com/feeds/example-feed.xml").

The URL that is currently used for the channel is taken from the <link> provided by the RSS feed, which as per the spec should be:

The URL to the HTML website corresponding to the channel.

If a feed specifies the <link> as the link to the feed rather than the site itself, I believe that's an issue with the feed. We could potentially check for <link> == feedURL and only then convert it to the base URL assuming no public-url is provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants