{#
================================================================================
Post Card Component (Shared)
================================================================================
Single shared component for blog post cards with variants: featured, default,
compact. Uses PostView for normalized access. All links use p.href (includes
baseurl for GitHub Pages / subpath deployment).
Usage:
{{ post_card(post, variant='default', show_image=true, show_excerpt=true) }}
Variants:
- featured: larger card, gradient-border-strong fluid-bg, full date format
- default: standard card, gradient-border fluid-combined, time_ago
- compact: minimal (title, date, optional excerpt)
================================================================================
#}
{% from 'partials/components/tags.html' import tag_list %}
{% def post_card(post, variant='default', show_image=true, show_excerpt=true) %}
{% let p = post | post_view %}
{% if p %}
{% let theme_features = theme?.features ?? [] %}
{% match variant %}
{% case 'featured' %}
{% if show_image and p.image %}
{% end %}
{% if (p.author and 'content.author' in theme_features) or p.date or (p.reading_time > 0 and 'content.reading_time' in theme_features) %}
{% if p.author and 'content.author' in theme_features %}
{% if p.author_avatar %}
{% end %}
{{ p.author }}
{% end %}
{% if p.date %}
{% end %}
{% if p.reading_time > 0 and 'content.reading_time' in theme_features %}
{{ p.reading_time }} min read
{% end %}
{% if (p.author and 'content.author' in theme_features) or p.date or (p.reading_time > 0 and 'content.reading_time' in theme_features) %}
{% if p.author and 'content.author' in theme_features %}
{% if p.author_avatar %}
{% end %}
{{ p.author }}
{% end %}
{% if p.date %}
{% end %}
{% if p.reading_time > 0 and 'content.reading_time' in theme_features %}
{{ p.reading_time }} min read
{% end %}