Files
larablog/themes/default/views/category.blade.php
T
gouki 3cec4c5e18
CI / PHPUnit (PHP 8.3) (push) Failing after 4s
CI / PHPUnit (PHP 8.2) (push) Failing after 1m9s
CI / Deploy (manual gate) (push) Skipped
wip: article AI polish, category SEO fields, cover generator, membership plan seeder
2026-09-07 18:48:37 +00:00

42 lines
1.9 KiB
PHP

@extends('theme::layout')
@section('content')
<header class="category-hero panel">
@if(filled($category->coverUrl()))
<figure class="category-hero__cover">
<img src="{{ $category->coverUrl() }}" alt="{{ $category->name }}">
</figure>
@endif
<h1 class="page-title">{{ $category->name }}</h1>
@if(filled($category->intro))
<div class="category-hero__intro">{!! nl2br(e($category->intro)) !!}</div>
@elseif(filled($category->description))
<p class="excerpt">{{ $category->description }}</p>
@endif
<p class="meta">{{ __('frontend.category.post_count', ['count' => $articles->total()]) }}</p>
</header>
<div class="post-list">
@forelse($articles as $article)
<article class="post-item">
@if($article->hasCover() && ($coverUrl = $article->coverUrl()))
<a class="post-item__cover" href="{{ url('/show-'.$article->id.'.shtml') }}">
<img src="{{ $coverUrl }}" alt="{{ $article->title }}" loading="lazy">
</a>
@endif
<h2><a href="{{ url('/show-'.$article->id.'.shtml') }}">{{ $article->title }}</a></h2>
<p class="meta">
{{ optional($article->published_at)->format('Y-m-d') }}
· {{ strtoupper($article->content_format) }}
@if($article->stick) · {{ __('frontend.common.pinned') }} @endif
</p>
<p class="excerpt">{{ app(\App\Domain\Blog\ArticleExcerpt::class)->forList($article) }}</p>
</article>
@empty
<div class="panel">
<p class="meta">{{ __('frontend.common.no_posts') }}</p>
</div>
@endforelse
</div>
<div class="pagination">{{ $articles->links() }}</div>
@endsection