added RSS Feed

This commit is contained in:
jonas.psotka 2022-06-23 09:06:29 +02:00
parent 3d658f2c5c
commit 55f9cd0df9
2 changed files with 33 additions and 1 deletions

View file

@ -41,7 +41,7 @@
<section>
<p>Linkpage: <a href="https://nikurasu.de">https://nikurasu.de</a></p>
<p>E-Mail: <a href="mailTo({{ $page->email }})">{{ $page->email }}</p>
<p><a href="/feed.rss">RSS-Feed</a></p>
<p><a href="/rss.xml">RSS-Feed</a></p>
<p><a href="#">Proof of Identity</a></p>
</section>
</div>

32
source/rss.blade.xml Normal file
View file

@ -0,0 +1,32 @@
{!! '<'.'?'.'xml version="1.0" encoding="UTF-8" ?>' !!}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>{{ $page->siteName }}</title>
<link>{{ $page->baseUrl }}</link>
<description><![CDATA[{{ $page->siteDescription }}]]></description>
<atom:link href="{{ $page->getUrl() }}" rel="self" type="application/rss+xml" />
<language>{{ $page->siteLanguage }}</language>
<lastBuildDate>{{ date(DateTime::RSS, $posts->first()->date) }}</lastBuildDate>
@foreach($posts as $post)
<item>
<title><![CDATA[{!! $post->title !!}]]></title>
<link>{{ $post->getUrl() }}</link>
<guid isPermaLink="true">{{ $post->getUrl() }}</guid>
<description><![CDATA[{!! $post->description !!}]]></description>
<content:encoded><![CDATA[{!! $post->getContent() !!}]]></content:encoded>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">{{ $post->author }}</dc:creator>
<pubDate>{{ date(DateTime::RSS, $post->date) }}</pubDate>
@if($post->cover_image)
<media:content
medium="image"
url="{{ $page->baseUrl . $post->cover_image }}"
type="image/jpeg"
width="150"
height="150" />
@endif
</item>
@endforeach
</channel>
</rss>