<?xml version="1.0" encoding="UTF-8" ?>

@if(!isset($details))
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <sitemap>
              <loc>{{ url('sitemap/pages') }}</loc>
              <lastmod>{{ $page->created_at->tz('UTC')->toAtomString() }}</lastmod>
      </sitemap>
    <sitemap>
              <loc>{{ url('sitemap/blogs') }}</loc>
              <lastmod>{{ $blog->created_at->tz('UTC')->toAtomString() }}</lastmod>
      </sitemap>


</sitemapindex>
@else
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      @foreach ($details as $detail)
              <url>
              @if($type == 'pages')
                              <loc>{{ url($detail->slug) }}</loc>
                      @elseif($type == 'blogs')
        <loc>{{ url('blog/'.$detail->slug) }}</loc>
                      @endif
                      <lastmod>{{ $detail->created_at->tz('UTC')->toAtomString() }}</lastmod>
                      <changefreq>weekly</changefreq>
                      <priority>0.6</priority>
              </url>
      @endforeach
</urlset>
@endif
