<article class="post-card {{ $post->is_sticky ? 'sticky' : '' }}">
    @if($cover = $post->getFirstMedia('cover'))
        <a href="{{ route('posts.show', $post->slug ?: $post->id) }}" class="post-cover">
            <img src="{{ $cover->getUrl('card') ?: $cover->getUrl() }}" alt="{{ $post->title }}" loading="lazy">
        </a>
    @endif
    <h2 class="post-title">
        @if($post->is_sticky)<span class="badge">置顶</span>@endif
        <a href="{{ route('posts.show', $post->slug ?: $post->id) }}">{{ $post->title }}</a>
    </h2>
    <div class="post-meta">
        <time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('normaltime', 'Y-m-d H:i')) }}</time>
        @if($post->category)
            <span>·</span>
            <a href="{{ route('category.show', $post->category->slug ?: $post->category->id) }}">{{ $post->category->name }}</a>
        @endif
        <span>· 阅读 {{ $post->views }}</span>
        <span>· 评论 {{ $post->comment_count }}</span>
    </div>
    <div class="post-excerpt">
        {{ Str::limit(strip_tags($post->excerpt_or_fallback), 200) }}
    </div>
    <div class="post-footer">
        <a href="{{ route('posts.show', $post->slug ?: $post->id) }}" class="read-more">阅读全文 &raquo;</a>
        @foreach($post->tags as $tag)
            <a href="{{ route('tags.show', $tag->slug ?: $tag->name) }}" class="tag-link">#{{ $tag->name }}</a>
        @endforeach
    </div>
</article>
