{# ================================================================================ 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) }} ================================================================================ #} {% def blog_post_meta(author, avatar='', title='', date=none, reading_time=0, views=none, show_author=true, show_reading_time=true, updated=none) %}
{# Metadata row: date, reading time, last updated, views #}
{% if date %} {% end %} {% if show_reading_time and reading_time and reading_time > 0 %} {{ icon('clock', size=14) }} {{ reading_time }} min read {% end %} {% if updated and updated != date %} Updated {{ updated | dateformat('%B %d, %Y') }} {% end %} {% if views %} {{ icon('eye', size=14) }} {{ views }} views {% end %}
{# Mini author card #} {% if show_author and author %}
{% if avatar %} {{ author }} {% end %}
{{ author }} {% if title %} {{ title }} {% end %}
{% end %}
{% end %}