RSS is not valid

AI 生成的摘要

The discussion revolves around an issue with RSS validation in Discourse. magicknot reported that the RSS feed of their Discourse setup was not validating due to a line of code (<language>#{lang}</language>) that caused an error. codinghorror suspected a bug and techAPJ initially found that the RSS feeds of other Discourse forums were validating correctly.

However, after further investigation, codinghorror discovered that the issue was caused by setting a language in Site Settings, which made the RSS feed invalid. techAPJ subsequently fixed the bug through a commit on GitHub, and the RSS feed now validates correctly.

Meanwhile, Mohammad found the discussion helpful in learning that Discourse has an RSS feed file that can be submitted to Google Webmasters, which he successfully applied to his own forum.

Hello!

Firstly I want to congratulate Discourse team for this awesome product!

I’m currently having a problem validating RSS feeds of pages in my Discourse setup (p.e. latest.rss).

The error is caused by:

<language>#{lang}</language>

How can I fix this?

Thanks in advance :slight_smile:

Hmm that looks like a bug, @techapj can you have a look?

The RSS feed for meta & try (latest) shows as valid:

meta: Feed Validator Results: https://meta.discourse.org/latest.rss

try: Feed Validator Results: http://try.discourse.org/latest.rss

Thank you @techAPJ ! You just let me know that discourse even has a RSS feed file that could be submitted to Google webmasters. I just did and google did accept that. We normally apply this technique in Blogger blogs but didn’t knew we could also for discourse. This RSS file was just I needed. Our Forum category pages and topics at Ask.mybloggertricks.com are well picked by Google. Since I just submitted the sitemap as RSS so it would take time for them to be indexed. Glad I read this thread. 5 stars!

Yes, I know that. I tested with a couple more discourse forums I know and it all looked fine. But with my own discourse installation I got this:

I can’t upload an image, so here it is: Imgur: The magic of the Internet

Did you install your Discourse via our official Docker install?

Yes I have. Even yesterday I’d updated it to the most recent version.

@techapj did we test setting a language in Site Settings? Does that cause it to happen?

This is the relevant line

<% if lang %><language>#{lang}</language><% end %>

I do think this is a legit bug.

@codinghorror just fixed this issue:

This was a legit bug, I just tested the RSS feed for French language before and after the change, and the RSS feed was was not validating before the change but validates now.

Thanks for reporting it @magicknot, I should have taken this more seriously.