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

24 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($blogs) > 0)
@foreach ($blogs as $blog)
<url>
@if ($blog->status == 1)
<loc>{{ route('detail', ['slug' => $blog->slug]).'/' }}</loc>
<lastmod>{{ $blog->updated_at->setTimezone('Asia/Tehran')->toAtomString() }}</lastmod>
<image:image>
<image:loc>{{ env('APP_URL_IMAGE').'images/'.$blog->image }}</image:loc>
</image:image>
@if (isset($blogImages[$blog->id]))
@foreach ($blogImages[$blog->id] as $imageUrl)
<image:image>
<image:loc>{{ $imageUrl }}</image:loc>
</image:image>
@endforeach
@endif
@endif
</url>
@endforeach
@endif
</urlset>