Ok, all fixed and now both RSS and ATOM feeds are valid. @AmauryPi - If you still come around here, could you please consider making the following updates? If you don't come back and reply here, maybe after a few more weeks to a month, I'll fork this and re-release it. FYI, @arthrfrts. Edit: I went ahead and forked and did a pull request. See this post below.

Here's what you need to do everyone... it's very simple. Edit two files.

  1. atom.blade.php
  2. rss.blade.php
    Both are within this extension's views folder.

Replace atom.blade.php's code with:

{!! '<'.'?xml version="1.0" encoding="utf-8"?'.'>' !!}

<feed xmlns="http://www.w3.org/2005/Atom">

    <title><![CDATA[{!! $title !!}]]></title>
    <subtitle><![CDATA[{!! $description !!}]]></subtitle>
    <link href="{{ $self_link }}" rel="self" />
    <link href="{{ $link }}" />
    <id><![CDATA[{!! $link !!}]]></id>
    <updated>{{ $pubDate->format(DateTime::ATOM) }}</updated>

    @foreach ($entries as $entry)
    <entry>
        <title><![CDATA[{!! $entry['title'] !!}]]></title>
        <link rel="alternate" type="text/html" href="{{ $entry['permalink'] }}"/>
        <id>{{ $entry['permalink'] }}</id>
        <updated>{{ $entry['pubdate']->format(DateTime::ATOM) }}</updated>
        <summary><![CDATA[{!! $entry['description'] !!}]]></summary>
        <content type="html"><![CDATA[{!! $entry['content'] !!}]]></content>
        <author>
            <name>{{ $entry['author'] }}</name>
        </author>
    </entry>
    @endforeach

</feed>

Replace rss.blade.php's code with:

{!! '<'.'?xml version="1.0" encoding="utf-8"?'.'>' !!}

<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">

    <channel>
        <title><![CDATA[{!! $title !!}]]></title>
        @if (!empty($description))<description><![CDATA[{!! $description !!}]]></description>@endif
        <link><![CDATA[{!! $link !!}]]></link>
        <pubDate>{{ $pubDate->format(DateTime::RSS) }}</pubDate>
        <atom:link href="{{ $self_link }}" rel="self" type="application/rss+xml" />

        @foreach ($entries as $entry)
        <item>
            <title><![CDATA[{!! $entry['title'] !!}]]></title>
            <description><![CDATA[{!! $entry['description'] !!}]]></description>
            <content:encoded><![CDATA[{!! $entry['content'] !!}]]></content:encoded>
            <guid>{{ $entry['permalink'] }}</guid>
            <pubDate>{{ $entry['pubdate']->format(DateTime::RSS) }}</pubDate>
        </item>
        @endforeach

    </channel>

</rss>

Final tip - up to you if you want to do this. The feeds are more likely to validate if you remove the full content portion of each feed. In other words, the code above includes a description/summary, plus full content with HTML tags. Feed validators don't like certain HTML tags. Plus, maybe you don't want people to be able to subscribe to a feed and see EVERYTHING. If this is the case, then...

In the above atom code remove this line:
<content type="html"><![CDATA[{!! $entry['content'] !!}]]></content>

In the rss code, remove:
<content:encoded><![CDATA[{!! $entry['content'] !!}]]></content:encoded>

Now you will still have all of the important parts of the feeds, including a description or summary of posts, but you won't have the full HTML of the posts.

Edit: @AmauryPi - In the pull request I went with taking the full HTML content portions out. It’s obviously up to you if you want to leave it that way. As you’ll see above, I had feed validation issues when leaving the full HTML content lines in. And so my pull request sticks with the basic text summaries only.

    010101 You may have better odds forking your changes and linking to the repo until/unless you can make a pull request. I didn't read into the changes although your instructions were clear, it just left me thinking a git DIFF would suffice without the expense of your time detailing changes here. easier for people who would just rather clone, update, or not otherwise edit anything manually

      010101 Thank you for fixing. Yandex.Turbo Pages users should use this code:

      {!! '<'.'?xml version="1.0" encoding="utf-8"?'.'>' !!}
      
      <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:turbo="http://turbo.yandex.ru">
      
          <channel>
              <title><![CDATA[{!! $title !!}]]></title>
              @if (!empty($description))<description><![CDATA[{!! $description !!}]]></description>@endif
              <link><![CDATA[{!! $link !!}]]></link>
              <pubDate>{{ $pubDate->format(DateTime::RSS) }}</pubDate>
              <atom:link href="{{ $self_link }}" rel="self" type="application/rss+xml" />
      
              @foreach ($entries as $entry)
              <item turbo="true">
                  <title><![CDATA[{!! $entry['title'] !!}]]></title>
                  <description><![CDATA[{!! $entry['content'] !!}]]></description>
                  <turbo:content><![CDATA[{!! $entry['content'] !!}]]></turbo:content>
                  <link>{{ $entry['permalink'] }}</link>
                  <guid>{{ $entry['permalink'] }}</guid>
                  <pubDate>{{ $entry['pubdate']->format(DateTime::RSS) }}</pubDate>
              </item>
              @endforeach
      
          </channel>
      
      </rss>

      Edited for v0.3.1

        tolgaaaltas
        <yandex:full-text><![CDATA[{!! $entry['content'] !!}]]></yandex:full-text>

        Error: This page contains the following errors:
        error on line 15 at column 30: Namespace prefix yandex on full-text is not defined
        Below is a rendering of the page up to the first error.

          Alkir This codes uses only with Yandex Turbo Pages service, so this is mean not a global code. More info here.

          5 days later
          9 days later

          The fix has been published, along with other features:

          • new translations;
          • new settings to configure the feeds: extracts or full text; HTML or plain; and number of entries per feed;
          • compatibility fixes;
          • improved documentation.

          Get it using Bazaar or:

          composer require amaurycarrade/flarum-ext-syndication
          php flarum cache:clear

          Thanks for your patience!

            AmauryPi Hey, thanks for all this work and the updates! I haven’t tried it yet, I guess I need to actually try it before asking this but... looking at the code, how does it switch between HTML or plain text? Because the way I’m doing it is swapping out $entry['content'] for $entry['description'] in the rss/atom blade files. But I see you stuck with content and it looks like only the type=html is added or removed by the settings. For me, the magical solution to ensuring a plain text feed which I like (because I want people to visit the actual forum) was using description instead of content.

              AmauryPi Thanks for such an awesome extension. Now we can finally use Google Feedburner to give an email newsletter subscription of all the new discussions with unlimited subscriber facility for free, even to non-registered members.

              There is one issue. The html5 videos which I embed via the autovideo of the Formatting extension are not responsive in the feed. They are getting cut off on the right. This was the css which fixed it:

              video {
              width: 100%;
              height: auto;
              }

              How can we make this same css work for your feeds so that the videos are fixed in the feeds, email newsletters and on feedly.com reader too?

              Also, any plans to add podcast support in the feeds so that we can submit podcast feeds of a Video tag to the Apple directory etc? It should be quite simple to add. Even Wordpress.com feeds have that. I can donate for your time to add podcast functionality please, because our visitors really like a way to listen and watch our meditation podcasts in their default podcast app after downloading them offline in the podcast apps and also be notified about new episodes, and also continue watching from where they left off in their favorite podcast app. We self-host our videos and audios so this will be great blessing for us. Thanks again for updating it.

                AmauryPi Is it possible to also have a feed for the recent posts in all the discussions just like the comments feed in Wordpress for regular members to keep in touch via the RSS feeds in something like Feedly reader? Thanks.

                  Thanks again @AmauryPi! I finally got around to updating this and it works great! The feeds validate. But, there is a warning which is easy to fix. For whatever reason, the feed validators don't like the link to the feed to end in a slash. It likes the other links to end in a slash, but not the feed URL. I have no idea why... and it could even be that the feed validator is wrong. But, to get rid of that warning, here's the fix...

                  The validator gives me a warning with:

                  <link href="https://mysite.com/atom/" rel="self" />

                  If I remove the slash at the end of the URL so that it looks like the following that warning goes away:

                  <link href="https://mysite.com/atom" rel="self" />

                  Remove the slash in AbstractFeedController.php on line 124:

                  'self_link' => rtrim($request->getUri(), " \t\n\r\0\v/") . "/",

                  End result:

                  'self_link' => rtrim($request->getUri(), " \t\n\r\0\v/"),

                    I tried to add it to the root of the extension itself, but after adding to the site, a 500 error occurs

                      Alkir You can't add with FTP. I told you, install with composer Linguist extension and translate words. After than, clear cache.

                      5 days later

                      Alkir I don't speak russian. But if you provide a translation file (you can use the English language as a template), I'll happily add it to the extension.

                      Alkir I tried to add it to the root of the extension itself, but after adding to the site, a 500 error occurs

                      You may have a YAML formatting error. You can check your file here.

                      010101 If it's only a warning, it will not break any aggregator. In fact, most of the RSS feeds are invalid, so modern aggregators are pretty resilient to errors. A slash won't scare them off. This being said, I may fix this in a close-future update (because I'm a perfectionist). So, thanks for the patch 🙂 .

                      nitaaikumar AmauryPi Is it possible to also have a feed for the recent posts in all the discussions just like the comments feed in Wordpress for regular members to keep in touch via the RSS feeds in something like Feedly reader? Thanks.

                      Something like https://your-forum.eu/atom (or /rss)? If I understand correctly, it's already available 🙂 .