Files
omg-wtf-ai/resources/views/blog/show.blade.php
T
2026-08-09 04:19:21 +03:00

58 lines
2.4 KiB
PHP

<x-layouts.app :title="$title" :description="$description" :canonical="$canonical" :image="$image ?? null" type="article">
@push('jsonld')
<script type="application/ld+json">
{!! json_encode([
'@@context' => 'https://schema.org',
'@type' => 'BlogPosting',
'headline' => $post->title,
'description' => $description,
'datePublished' => $post->published_at->toIso8601String(),
'dateModified' => $post->updated_at->toIso8601String(),
'author' => [
'@type' => 'Person',
'name' => $post->user->name,
],
'mainEntityOfPage' => [
'@type' => 'WebPage',
'@id' => $canonical,
],
...($image ?? null ? ['image' => [$image]] : []),
]) !!}
</script>
@endpush
<article>
<p class="text-sm text-neutral-500">
<a href="{{ route('blog.index') }}" class="hover:underline">Blog</a>
@if ($post->category)
<span aria-hidden="true">/</span>
<a href="{{ route('blog.category', $post->category) }}" class="hover:underline">{{ $post->category->name }}</a>
@endif
</p>
<h1 class="mt-2 text-4xl font-bold tracking-tight">{{ $post->title }}</h1>
<div class="mt-3 flex flex-wrap items-center gap-3 text-sm text-neutral-500">
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format('F j, Y') }}</time>
<span aria-hidden="true">&middot;</span>
<span>{{ $post->user->name }}</span>
</div>
@if ($post->featured_image)
<img src="{{ asset('storage/'.$post->featured_image) }}" alt="{{ $post->title }}" class="mt-8 w-full rounded-lg">
@endif
<div class="prose prose-neutral mt-8 max-w-none">
{!! $post->body_html !!}
</div>
@if ($post->tags->isNotEmpty())
<div class="mt-10 flex flex-wrap gap-2 border-t border-neutral-200 pt-6">
@foreach ($post->tags as $tag)
<a href="{{ route('blog.tag', $tag) }}" class="rounded-full bg-neutral-100 px-3 py-1 text-sm hover:bg-neutral-200">#{{ $tag->name }}</a>
@endforeach
</div>
@endif
</article>
</x-layouts.app>