{# The post a reply answers (v2.19.0). The card is the note's u-in-reply-to h-cite (Post Type Discovery reads it as a reply). Avatars and images are this site's saved copies; until there is one, the initial is shown and the image left out. #} {% macro _who(ctx, url) %}{{ ctx.author_name or ctx.site_name or url.split('/')[2] }}{% endmacro %} {% macro _when(ctx, fmt) %} {%- set when = ctx.published_at -%} {%- if when and when.strftime is defined -%} {%- endif -%} {% endmacro %} {# Full card, on the note's page #} {% macro reply_card(url, ctx) %} {% set fetched = ctx and ctx.fetch_status == 'fetched' %}
↩ In reply to
{% if fetched and (ctx.author_name or ctx.content_snippet or ctx.title) %}
{% set avatar = ctx.author_photo|local_avatar %} {%- if avatar %} {%- else %}{% endif %} {%- if ctx.author_url %}{{ _who(ctx, url) }} {%- else %}{{ _who(ctx, url) }}{% endif %} {%- if ctx.author_handle %} {{ ctx.author_handle }}{% endif -%}
{% if ctx.title %}

{{ ctx.title }}

{% endif %} {% if ctx.content_snippet %}
{{ ctx.content_snippet|safe }}
{% endif %} {% set image = ctx.photo|local_preview %} {% if image %}{{ ctx.photo_alt or '' }}{% endif %} {% else %} {{ url }} {% endif %}
{% endmacro %} {# One line and a short quote, in lists of notes #} {% macro reply_line(url, ctx) %} {% set fetched = ctx and ctx.fetch_status == 'fetched' %}
↩ In reply to {% if fetched and (ctx.author_name or ctx.title) %} {{ ctx.title or ctx.author_name }} {%- if ctx.title and ctx.author_name %} by {{ ctx.author_name }}{% endif %} {% set quote = ctx.content_snippet|striptags|replace('\n', ' ')|trim if ctx.content_snippet else '' %} {% if quote and not ctx.title %}{{ quote|truncate(140) }}{% endif %} {% else %} {{ url }} {% endif %}
{% endmacro %}