You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/resources/views/website/sitemaps/sitemap.blade.php

51 lines
1.6 KiB
PHTML

1 month ago
<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@if(\App\Models\Product::count() > 0)
<sitemap>
<loc>{{route('sitemap.products')}}</loc>
<lastmod>{{\App\Models\Product::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
</sitemap>
@endif
@if(\App\Models\Post::count() > 0)
<sitemap>
<loc>{{route('sitemap.posts')}}</loc>
<lastmod>{{\App\Models\Post::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
</sitemap>
@endif
@if(\App\Models\Gallery::count() > 0)
<sitemap>
<loc>{{route('sitemap.galleries')}}</loc>
<lastmod>{{\App\Models\Gallery::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
</sitemap>
@endif
@if(\App\Models\Clip::count() > 0)
<sitemap>
<loc>{{route('sitemap.clips')}}</loc>
<lastmod>{{\App\Models\Clip::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
</sitemap>
@endif
@if(\App\Models\Attachment::count() > 0)
<sitemap>
<loc>{{route('sitemap.attachments')}}</loc>
<lastmod>{{\App\Models\Attachment::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
</sitemap>
@endif
</sitemapindex>