more fixes
This commit is contained in:
113
resources/views/news/show.blade.php
Normal file
113
resources/views/news/show.blade.php
Normal file
@@ -0,0 +1,113 @@
|
||||
@extends('news.layout', [
|
||||
'metaTitle' => $article->meta_title ?: $article->title,
|
||||
'metaDescription' => $article->meta_description ?: Str::limit(strip_tags((string)$article->excerpt), 160),
|
||||
])
|
||||
|
||||
@section('news_content')
|
||||
|
||||
{{-- OpenGraph meta --}}
|
||||
@push('head')
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:title" content="{{ $article->effective_og_title }}">
|
||||
<meta property="og:description" content="{{ $article->effective_og_description }}">
|
||||
@if($article->effective_og_image)
|
||||
<meta property="og:image" content="{{ $article->effective_og_image }}">
|
||||
@endif
|
||||
<meta property="article:published_time" content="{{ $article->published_at?->toIso8601String() }}">
|
||||
<meta property="article:author" content="{{ $article->author?->name }}">
|
||||
@if($article->meta_keywords)
|
||||
<meta name="keywords" content="{{ $article->meta_keywords }}">
|
||||
@endif
|
||||
@endpush
|
||||
|
||||
<div class="news-article">
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
|
||||
{{-- Cover image --}}
|
||||
@if($article->cover_url)
|
||||
<img src="{{ $article->cover_url }}" class="img-fluid rounded mb-4 w-100"
|
||||
alt="{{ $article->title }}" style="max-height:450px;object-fit:cover;">
|
||||
@endif
|
||||
|
||||
{{-- Meta --}}
|
||||
<div class="d-flex align-items-center mb-3 text-muted small">
|
||||
@if($article->category)
|
||||
<a href="{{ route('news.category', $article->category->slug) }}"
|
||||
class="badge badge-primary mr-2">{{ $article->category->name }}</a>
|
||||
@endif
|
||||
<span>{{ $article->author?->name }}</span>
|
||||
<span class="mx-2">·</span>
|
||||
<span>{{ $article->published_at?->format('d M Y') }}</span>
|
||||
<span class="mx-2">·</span>
|
||||
<span><i class="fas fa-clock mr-1"></i>{{ $article->reading_time }} min read</span>
|
||||
<span class="mx-2">·</span>
|
||||
<span><i class="fas fa-eye mr-1"></i>{{ number_format($article->views) }}</span>
|
||||
</div>
|
||||
|
||||
<h1 class="mb-3">{{ $article->title }}</h1>
|
||||
|
||||
@if($article->excerpt)
|
||||
<p class="lead text-muted mb-4">{{ $article->excerpt }}</p>
|
||||
@endif
|
||||
|
||||
<div class="news-content">
|
||||
{!! $article->content !!}
|
||||
</div>
|
||||
|
||||
{{-- Tags --}}
|
||||
@if($article->tags->isNotEmpty())
|
||||
<div class="mt-4">
|
||||
<strong><i class="fas fa-tags mr-1"></i></strong>
|
||||
@foreach($article->tags as $tag)
|
||||
<a href="{{ route('news.tag', $tag->slug) }}"
|
||||
class="badge badge-secondary mr-1">{{ $tag->name }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Share buttons --}}
|
||||
<div class="mt-4 pt-4 border-top">
|
||||
<strong>Share:</strong>
|
||||
<a href="https://twitter.com/intent/tweet?url={{ urlencode(url()->current()) }}&text={{ urlencode($article->title) }}"
|
||||
class="btn btn-sm btn-info ml-2" target="_blank" rel="noopener noreferrer">
|
||||
<i class="fab fa-twitter"></i> Twitter
|
||||
</a>
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u={{ urlencode(url()->current()) }}"
|
||||
class="btn btn-sm btn-primary ml-2" target="_blank" rel="noopener noreferrer">
|
||||
<i class="fab fa-facebook"></i> Facebook
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- Forum discussion link --}}
|
||||
@if($article->forum_thread_id)
|
||||
<div class="mt-4 alert alert-secondary">
|
||||
<i class="fas fa-comments mr-2"></i>
|
||||
<strong>Join the discussion:</strong>
|
||||
<a href="{{ url('/forum/thread/discussion-' . $article->slug) }}" class="ml-1">
|
||||
Discussion: {{ $article->title }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Related articles --}}
|
||||
@if($related->isNotEmpty())
|
||||
<div class="mt-5">
|
||||
<h4 class="mb-3">Related Articles</h4>
|
||||
<div class="row">
|
||||
@foreach($related as $rel)
|
||||
<div class="col-sm-6 mb-3">
|
||||
@include('news._article_card', ['article' => $rel])
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>{{-- col-lg-8 --}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user