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-attachments.blade.php

54 lines
2.2 KiB
PHTML

@cache('sitemap_attach'. cacheNumber(), 3600)
{{--update every 1 hour--}}
2 months ago
<urlset 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/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@if(\App\Models\Attachment::count() > 0)
<url>
<loc>{{route('client.attachments')}}</loc>
<lastmod>{{\App\Models\Attachment::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
<changefreq>weekly</changefreq>
2 months ago
<priority>0.7</priority>
2 months ago
</url>
@endif
@foreach(\App\Models\Attachment::where('is_fillable',1)->orderBy('id')->get(['slug','updated_at']) as $item)
<url>
<loc>{{route('client.attachment',$item->slug)}}</loc>
<lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>
<changefreq>weekly</changefreq>
2 months ago
<priority>0.5</priority>
2 months ago
</url>
@endforeach
@if(config('app.xlang.active'))
@foreach(\App\Models\XLang::where('is_default',0)->pluck('tag')->toArray() as $lang)
@php(app()->setLocale($lang))
@if(\App\Models\Attachment::count() > 0)
<url>
<loc>{{route('client.attachments')}}/{{$lang}}</loc>
<lastmod>{{\App\Models\Attachment::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
<changefreq>weekly</changefreq>
2 months ago
<priority>0.7</priority>
2 months ago
</url>
@endif
@foreach(\App\Models\Attachment::where('is_fillable',1)->whereLocale('title',$lang)->orderBy('id')->get(['slug','updated_at','title']) as $item)
<url>
<loc>{{$item->webUrl()}}</loc>
<lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>
<changefreq>weekly</changefreq>
2 months ago
<priority>0.5</priority>
2 months ago
</url>
@endforeach
@endforeach
@endif
</urlset>
@endcache