Skip to content

Commit

Permalink
fix: feed category
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Sep 20, 2023
1 parent 43791aa commit 273571e
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions src/resources/views/rss/feed.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
<?=
'<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL
?>
'<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ?>
<rss version="2.0">
<channel>
<title><![CDATA[ {{ config('app.name') }} ]]></title>
<link><![CDATA[ {{ config('app.url') }} ]]></link>
<description><![CDATA[ Minimalist blog featuring syntax highlighting, images, comments, themes, and SEO out of the box. ]]></description>
<title>
<![CDATA[ {{ config('app.name') }} ]]>
</title>
<link>
<![CDATA[ {{ config('app.url') }} ]]>
</link>
<description>
<![CDATA[ Minimalist blog featuring syntax highlighting, images, comments, themes, and SEO out of the box. ]]>
</description>
<language>en</language>
<pubDate>{{ now() }}</pubDate>

@foreach($posts as $post)
@foreach ($posts as $post)
<item>
<title><![CDATA[{{ $post->title }}]]></title>
<link>{{ url('/'.str_replace(' ','-',$post->user->name).'/'.$post->slug) }}</link>
<description><![CDATA[{!! $post->post !!}]]></description>
<category>@if (isset($post->category->category)) {{ $post->category->category }} @else {{ 'Uncategorized' }} @endif</category>
<author><![CDATA[{{ $post->user->name }}]]></author>
<title>
<![CDATA[{{ $post->title }}]]>
</title>
<link>{{ url('/' . str_replace(' ', '-', $post->user->name) . '/' . $post->slug) }}</link>
<description>
<![CDATA[{!! $post->post !!}]]>
</description>
<category>{{ $post->category->category }}</category>
<author>
<![CDATA[{{ $post->user->name }}]]>
</author>
<pubDate>{{ $post->created_at->toRssString() }}</pubDate>
</item>
@endforeach
Expand Down

0 comments on commit 273571e

Please sign in to comment.