@php use Botble\Blog\Models\Post; // Prev/next via composite (created_at, id) so seeded posts that share a // timestamp still navigate cleanly. Matches html/blog-single.html // nav-post-list and group-direc footer; Botble has no built-in helper. $prevPost = Post::query()->wherePublished() ->where(fn ($query) => $query ->where('created_at', '<', $post->created_at) ->orWhere(fn ($q) => $q->where('created_at', $post->created_at)->where('id', '<', $post->getKey()))) ->orderByDesc('created_at') ->orderByDesc('id') ->first(); $nextPost = Post::query()->wherePublished() ->where(fn ($query) => $query ->where('created_at', '>', $post->created_at) ->orWhere(fn ($q) => $q->where('created_at', $post->created_at)->where('id', '>', $post->getKey()))) ->orderBy('created_at') ->orderBy('id') ->first(); $blogIndexUrl = function_exists('get_blog_page_url') ? get_blog_page_url() : url('/'); $primaryCategory = $post->categories->first(); // Demo crumb chain is Home → Blog → Post Title (BlogService's default // injects the post category instead, which doesn't match the html/blog-single.html // demo). Override with a custom 3-level chain for the post detail header. $postCrumbs = [ ['label' => __('Home'), 'url' => url('/')], ['label' => __('Blog'), 'url' => $blogIndexUrl], ['label' => $post->name, 'url' => $post->url], ]; @endphp
@if ($prevPost) @else @endif @if ($nextPost) @else @endif
@if ($post->image)
{!! RvMedia::image($post->image, $post->name, 'hero-banner', false, ['loading' => 'eager']) !!}
@endif
@if ($primaryCategory) @endif

{{ $post->name }}

@include(Theme::getThemeNamespace('partials.blog.post-meta'))
{!! BaseHelper::clean($post->content) !!}
@if ($post->tags->isNotEmpty())

{{ __('Tags:') }}

@foreach ($post->tags as $tag) {{ $tag->name }} @endforeach
@endif
@if ($prevPost || $nextPost)
@if ($prevPost) @else @endif @if ($nextPost) @else @endif
@endif
@include(Theme::getThemeNamespace('partials.blog.sidebar'))
@if (is_plugin_active('blog')) @include(Theme::getThemeNamespace('partials.blog.related-posts')) @endif