{#
================================================================================
Blog Post Meta Component
================================================================================
Post metadata (date, reading time, updated, views) + mini author card.
Used in blog post hero. Order: metadata row first, then mini author card.
Usage:
{{ blog_post_meta(author, avatar, title, date, reading_time, views, show_author, show_reading_time, updated=none) }}
================================================================================
#}
{% from 'chirpui/badge.html' import badge %}
{% from 'chirpui/card.html' import card %}
{% from 'chirpui/layout.html' import cluster %}
{% def blog_post_meta(author, avatar='', title='', date=none, reading_time=0, views=none, show_author=true, show_reading_time=true, updated=none) %}
{% call cluster(gap='sm', cls='chirp-theme-blog-meta') %}
{% if date %}
{% end %}
{% if show_reading_time and reading_time and reading_time > 0 %}
{{ badge(reading_time ~ ' min read', variant='muted', icon='clock') }}
{% end %}
{% if updated and updated != date %}
{{ badge('Updated ' ~ (updated | dateformat('%B %d, %Y')), variant='muted') }}
{% end %}
{% if views %}
{{ badge(views ~ ' views', variant='muted', icon='eye') }}
{% end %}
{% end %}
{% if show_author and author %}
{% call card(title=author, subtitle=title if title else none, cls='chirp-theme-blog-author-card') %}
{% if avatar %}
{% slot media %}
{% end %}
{% end %}
{% end %}
{% end %}