@extends('layouts.nova') @php use App\Banner; $useUnifiedSeo = true; @endphp @php $seoPage = max(1, (int) request()->query('page', 1)); $seoBase = url()->current(); $seoQ = request()->query(); unset($seoQ['page']); $seoUrl = fn(int $p) => $seoBase . ($p > 1 ? '?' . http_build_query(array_merge($seoQ, ['page' => $p])) : (count($seoQ) ? '?' . http_build_query($seoQ) : '')); $seoPrev = $seoPage > 1 ? $seoUrl($seoPage - 1) : null; $seoNext = (isset($artworks) && method_exists($artworks, 'nextPageUrl')) ? $artworks->nextPageUrl() : null; @endphp @php $page_canonical = $page_canonical ?? $seoUrl($seoPage); $page_rel_prev = $page_rel_prev ?? $seoPrev; $page_rel_next = $page_rel_next ?? $seoNext; $page_robots = $page_robots ?? 'index,follow'; @endphp @php // ── Rank API endpoint ──────────────────────────────────────────────────── // Map the active sort alias to the ranking API ?type= parameter. // Only trending / fresh / top-rated have pre-computed ranking lists. $rankTypeMap = [ 'trending' => 'trending', 'fresh' => 'new_hot', 'top-rated' => 'best', ]; $rankApiType = $rankTypeMap[$current_sort ?? 'trending'] ?? null; $rankApiEndpoint = null; if ($rankApiType) { if (isset($category) && $category && $category->id ?? null) { $rankApiEndpoint = '/api/rank/category/' . $category->id; } elseif (isset($contentType) && $contentType && $contentType->slug ?? null) { $rankApiEndpoint = '/api/rank/type/' . $contentType->slug; } else { $rankApiEndpoint = '/api/rank/global'; } } $tagContext = ($gallery_type ?? null) === 'tag' ? ($tag_context ?? null) : null; @endphp @section('content') @endsection @push('scripts') @vite('resources/js/entry-masonry-gallery.jsx') @vite('resources/js/entry-pill-carousel.jsx') @endpush