forked from spatie/laravel-feed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.blade.php
48 lines (46 loc) · 1.71 KB
/
atom.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?=
/* Using an echo tag here so the `<? ... ?>` won't get parsed as short tags */
'<?xml version="1.0" encoding="UTF-8"?>'.PHP_EOL
?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ $meta['language'] }}">
@foreach($meta as $key => $metaItem)
@if($key === 'link')
<{{ $key }} href="{{ url($metaItem) }}" rel="self"></{{ $key }}>
@elseif($key === 'title')
<{{ $key }}><![CDATA[{{ $metaItem }}]]></{{ $key }}>
@elseif($key === 'description')
<subtitle>{{ $metaItem }}</subtitle>
@elseif($key === 'language')
@elseif($key === 'image')
@if(!empty($metaItem))
<logo>{!! $metaItem !!}</logo>
@else
@endif
@else
<{{ $key }}>{{ $metaItem }}</{{ $key }}>
@endif
@endforeach
@foreach($items as $item)
<entry>
<title><![CDATA[{{ $item->title }}]]></title>
<link rel="alternate" href="{{ url($item->link) }}" />
<id>{{ url($item->id) }}</id>
<author>
<name><![CDATA[{{ $item->authorName }}]]></name>
@if(!empty($item->authorEmail))
<email><![CDATA[{{ $item->authorEmail }}]]></email>
@endif
</author>
<summary type="html">
<![CDATA[{!! $item->summary !!}]]>
</summary>
@if($item->__isset('enclosure'))
<link href="{{ url($item->enclosure) }}" length="{{ $item->enclosureLength }}" type="{{ $item->enclosureType }}" />
@endif
@foreach($item->category as $category)
<category term="{{ $category }}" />
@endforeach
<updated>{{ $item->timestamp() }}</updated>
</entry>
@endforeach
</feed>