{# ================================================================================ Author Bio Component ================================================================================ Full author bio block: avatar, name, title, bio text, links. Used in blog post footer and about page. Usage: {{ author_bio(author, avatar, title, bio, links) }} ================================================================================ #} {% from 'chirpui/button.html' import btn %} {% from 'chirpui/card.html' import card %} {% from 'chirpui/layout.html' import cluster %} {% def author_bio(author, avatar='', title='', bio='', links=none) %} {% let link_list = links | default([]) %} {% call card(title='About ' ~ author, subtitle=title if title else none, cls='chirp-theme-author-bio') %} {% if avatar %} {% slot media %} {{ author }} {% end %} {% end %} {% if bio %}

{{ bio }}

{% end %} {% if link_list | length > 0 %} {% call cluster(gap='sm', cls='chirp-theme-author-bio__links') %} {% for link in link_list %} {% if link and (link?.href or link?.url) %} {% let link_url = link?.href ?? link?.url ?? '#' %} {% let link_text = link?.text ?? link?.name ?? 'Link' %} {{ btn(link_text, href=link_url, variant='secondary', size='sm', attrs_map={'target': '_blank', 'rel': 'noopener noreferrer'}) }} {% end %} {% end %} {% end %} {% end %} {% end %}