@extends('layouts.nova') @php $presentMd = $presentMd ?? \App\Services\ThumbnailPresenter::present($artwork, 'md'); $presentLg = $presentLg ?? \App\Services\ThumbnailPresenter::present($artwork, 'lg'); $presentXl = $presentXl ?? \App\Services\ThumbnailPresenter::present($artwork, 'xl'); $presentSq = $presentSq ?? \App\Services\ThumbnailPresenter::present($artwork, 'sq'); $canonicalUrl = route('art.show', ['id' => $artwork->id, 'slug' => $artwork->slug]); $meta = $meta ?? [ 'title' => trim((string) ($artwork->title ?? 'Artwork') . ' by ' . (string) ($artwork->user?->name ?? $artwork->user?->username ?? 'Unknown Author') . ' | Skinbase'), 'description' => (string) ($artwork->description ?? ''), 'canonical' => $canonicalUrl, 'og_image' => $presentXl['url'] ?? $presentLg['url'] ?? $presentMd['url'] ?? null, 'og_width' => $presentXl['width'] ?? $presentLg['width'] ?? null, 'og_height' => $presentXl['height'] ?? $presentLg['height'] ?? null, ]; $artworkData = $artworkData ?? []; $relatedItems = $relatedItems ?? []; $comments = $comments ?? []; @endphp @push('head') {{ $meta['title'] }} @if(!empty($meta['og_image'])) @if(!empty($meta['og_width'])) @endif @if(!empty($meta['og_height'])) @endif @endif @if(!empty($meta['og_image'])) @endif @php $authorName = $artwork->user?->name ?: $artwork->user?->username ?: null; $keywords = $artwork->tags->pluck('name')->filter()->unique()->values()->all(); $license = $artwork->license_url ?? null; $imageObject = [ '@context' => 'https://schema.org', '@type' => 'ImageObject', 'name' => (string) $artwork->title, 'description' => (string) ($artwork->description ?? ''), 'url' => $meta['canonical'], 'contentUrl' => $meta['og_image'] ?? null, 'thumbnailUrl' => $presentMd['url'] ?? ($meta['og_image'] ?? null), 'encodingFormat' => 'image/webp', 'width' => !empty($meta['og_width']) ? (int) $meta['og_width'] : null, 'height' => !empty($meta['og_height']) ? (int) $meta['og_height'] : null, 'author' => $authorName ? ['@type' => 'Person', 'name' => $authorName] : null, 'datePublished' => optional($artwork->published_at)->toAtomString(), 'license' => $license, 'keywords' => !empty($keywords) ? $keywords : null, ]; $creativeWork = [ '@context' => 'https://schema.org', '@type' => 'CreativeWork', 'name' => (string) $artwork->title, 'description' => (string) ($artwork->description ?? ''), 'url' => $meta['canonical'], 'author' => $authorName ? ['@type' => 'Person', 'name' => $authorName] : null, 'datePublished' => optional($artwork->published_at)->toAtomString(), 'license' => $license, 'keywords' => !empty($keywords) ? $keywords : null, 'image' => $meta['og_image'] ?? null, ]; $imageObject = array_filter($imageObject, static fn ($value) => $value !== null && $value !== ''); $creativeWork = array_filter($creativeWork, static fn ($value) => $value !== null && $value !== ''); $preloadSrcset = ($presentMd['url'] ?? '') . ' 640w, ' . ($presentLg['url'] ?? '') . ' 1280w, ' . ($presentXl['url'] ?? '') . ' 1920w'; @endphp @if(!empty($presentLg['url'])) @endif @endpush @section('content')
@vite(['resources/js/Pages/ArtworkPage.jsx']) @endsection