optimizations
This commit is contained in:
@@ -1,5 +1,26 @@
|
||||
@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')
|
||||
<title>{{ $meta['title'] }}</title>
|
||||
<meta name="description" content="{{ $meta['description'] }}">
|
||||
@@ -30,7 +51,7 @@
|
||||
|
||||
@php
|
||||
$authorName = $artwork->user?->name ?: $artwork->user?->username ?: null;
|
||||
$keywords = $artwork->tags->pluck('name')->merge($artwork->categories->pluck('name'))->filter()->unique()->implode(', ');
|
||||
$keywords = $artwork->tags->pluck('name')->filter()->unique()->values()->all();
|
||||
$license = $artwork->license_url ?? null;
|
||||
|
||||
$imageObject = [
|
||||
@@ -47,7 +68,7 @@
|
||||
'author' => $authorName ? ['@type' => 'Person', 'name' => $authorName] : null,
|
||||
'datePublished' => optional($artwork->published_at)->toAtomString(),
|
||||
'license' => $license,
|
||||
'keywords' => $keywords !== '' ? $keywords : null,
|
||||
'keywords' => !empty($keywords) ? $keywords : null,
|
||||
];
|
||||
|
||||
$creativeWork = [
|
||||
@@ -59,7 +80,7 @@
|
||||
'author' => $authorName ? ['@type' => 'Person', 'name' => $authorName] : null,
|
||||
'datePublished' => optional($artwork->published_at)->toAtomString(),
|
||||
'license' => $license,
|
||||
'keywords' => $keywords !== '' ? $keywords : null,
|
||||
'keywords' => !empty($keywords) ? $keywords : null,
|
||||
'image' => $meta['og_image'] ?? null,
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user