First of all, you need Syndication extension. Now, go composer and run this command:
composer require amaurycarrade/flarum-ext-syndication
On beta 10 (maybe also beta 9) this extension not works correctly. But fix is very easy.
- Connect with FTP to you server and go this directory: vendor/amaurycarrade/views
- Open rss.blade.php and replace all 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['description'] !!}]]></description>
<content:encoded><![CDATA[{!! $entry['content'] !!}]]></content:encoded>
<yandex:full-text><![CDATA[{!! $entry['content'] !!}]]></yandex:full-text>
<link>{{ $entry['permalink'] }}</link>
<guid>{{ $entry['permalink'] }}</guid>
<pubDate>{{ $entry['pubdate']->format(DateTime::RSS) }}</pubDate>
</item>
@endforeach
</channel>
</rss>
It's done for RSS. But you may also fix Atom feed.
- Open atom.blade.php and replace all code:
{!! '<'.'?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>
Thanks for fix to 010101. Yandex Turbo Pages editing by me.