Files
ahrommag/resources/views/sitemap/news.blade.php
2025-11-16 12:43:07 +03:30

23 lines
1.0 KiB
PHP

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
@if (count($news) > 0)
@foreach ($news as $new)
<url>
<loc>{{ route('detail', ['slug' => $new->slug]).'/' }}</loc>
<lastmod>{{ $new->updated_at->setTimezone('Asia/Tehran')->toAtomString() }}</lastmod>
<changefreq>{{ !is_null($new->changefreq) ? $new->changefreq : 'never' }}</changefreq>
<image:image>
<image:loc>{{ env('APP_URL_IMAGE').'images/'.$new->image }}</image:loc>
</image:image>
@if (isset($blogImages[$new->id]))
@foreach ($blogImages[$new->id] as $imageUrl)
<image:image>
<image:loc>{{ $imageUrl }}</image:loc>
</image:image>
@endforeach
@endif
</url>
@endforeach
@endif
</urlset>