la_bloger/resources/views/themes/default/posts/show.blade.php
2026-05-20 13:01:33 +02:00

70 lines
2.5 KiB
PHP

@extends('theme::layouts.app')
@section('meta_title', $publication->meta_title ?? $publication->title)
@section('meta_description', $publication->meta_description ?? '')
@section('og_type', 'article')
@section('og_title', $publication->meta_title ?? $publication->title)
@section('og_description', $publication->meta_description ?? '')
@section('og_image', $publication->og_image ?? '')
@section('canonical', $publication->canonical_url ?? url()->current())
@push('json_ld')
<script type="application/ld+json">
{
"@@context": "https://schema.org",
"@type": "Article",
"headline": {{ Js::from($publication->title) }},
"datePublished": "{{ $publication->published_at?->toIso8601String() }}",
"dateModified": "{{ $publication->updated_at->toIso8601String() }}",
"url": {!! Js::from($publication->canonical_url ?? url()->current()) !!}
@if($publication->post->author)
,"author": {
"@type": "Person",
"name": {{ Js::from($publication->post->author->name) }}
}
@endif
,"publisher": {
"@type": "Organization",
"name": {{ Js::from($channel->name) }}
}
@if($publication->og_image)
,"image": {{ Js::from($publication->og_image) }}
@endif
}
</script>
@endpush
@section('content')
<div class="max-w-3xl mx-auto px-6 py-12">
<header class="mb-8">
<h1 class="text-4xl font-bold leading-tight">{{ $publication->title }}</h1>
<div class="mt-3 text-sm text-gray-500 flex items-center gap-3">
@if($publication->post->author)
<span>{{ $publication->post->author->name }}</span>
<span>&middot;</span>
@endif
<time datetime="{{ $publication->published_at?->toDateString() }}">
{{ $publication->published_at?->format('d M Y') }}
</time>
</div>
@if($publication->taxonomyTerms->isNotEmpty())
<div class="mt-3 flex flex-wrap gap-2">
@foreach($publication->taxonomyTerms as $term)
<a href="/{{ $channel->taxonomy_slug }}/{{ $term->slug }}"
class="text-xs bg-gray-100 hover:bg-gray-200 px-2 py-1 rounded">
{{ $term->title }}
</a>
@endforeach
</div>
@endif
</header>
<div class="space-y-6">
@foreach($publication->blocks->sortBy('order') as $block)
@include('theme::blocks.' . $block->type, ['block' => $block])
@endforeach
</div>
</div>
@endsection