optimizations
This commit is contained in:
@@ -47,6 +47,34 @@
|
||||
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!}
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if(($gallery_type ?? null) === 'tag' && !empty($tag_context))
|
||||
<script type="application/ld+json">
|
||||
{!! json_encode([
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'CollectionPage',
|
||||
'name' => $page_title ?? ($hero_title ?? ('#' . ($tag_context['name'] ?? 'Tag'))),
|
||||
'description' => $page_meta_description ?? ($hero_description ?? null),
|
||||
'url' => $page_canonical ?? $seoUrl($seoPage),
|
||||
'mainEntity' => [
|
||||
'@type' => 'ItemList',
|
||||
'numberOfItems' => method_exists($artworks, 'total') ? $artworks->total() : count($artworks ?? []),
|
||||
'itemListElement' => collect(method_exists($artworks, 'getCollection') ? $artworks->getCollection() : ($artworks ?? []))
|
||||
->take(12)
|
||||
->values()
|
||||
->map(fn ($artwork, $index) => [
|
||||
'@type' => 'ListItem',
|
||||
'position' => $index + 1,
|
||||
'url' => !empty($artwork->slug) ? url('/' . $artwork->slug) : null,
|
||||
'name' => $artwork->name ?? null,
|
||||
])
|
||||
->filter(fn (array $item) => filled($item['url']) || filled($item['name']))
|
||||
->values()
|
||||
->all(),
|
||||
],
|
||||
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!}
|
||||
</script>
|
||||
@endif
|
||||
@endpush
|
||||
|
||||
@php
|
||||
|
||||
Reference in New Issue
Block a user