Initial commit
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
ssww23
2026-03-10 00:55:37 +03:00
parent fc0f28d830
commit 93a655235a
155 changed files with 24768 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
@if (!empty($items))
@php
$breadcrumbSchemaItems = collect($items)
->values()
->map(function ($item, $index) {
if (!is_array($item)) {
return null;
}
$label = trim((string) ($item['label'] ?? ''));
if ($label === '') {
return null;
}
$url = !empty($item['url']) ? (string) $item['url'] : url()->current();
return [
'@type' => 'ListItem',
'position' => $index + 1,
'name' => $label,
'item' => $url,
];
})
->filter()
->values()
->all();
$breadcrumbSchema = [
'@context' => 'https://schema.org',
'@type' => 'BreadcrumbList',
'itemListElement' => $breadcrumbSchemaItems,
];
@endphp
<nav class="pc-breadcrumbs" aria-label="Хлебные крошки">
@foreach ($items as $item)
@if (!$loop->last && !empty($item['url']))
<a href="{{ $item['url'] }}">{{ $item['label'] }}</a>
<span class="pc-breadcrumbs-sep">/</span>
@else
<span class="pc-breadcrumbs-current">{{ $item['label'] }}</span>
@endif
@endforeach
</nav>
@if (!empty($breadcrumbSchemaItems))
<script type="application/ld+json">
@json($breadcrumbSchema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)
</script>
@endif
@endif