Replies to Mastodon posts showed only the server's domain: the page has no h-entry, so nothing was found and the host stood in for the author. - Context sources in order: Bluesky AppView API, microformats, the origin's Mastodon API or this site's GoToSocial instance, OpenGraph - Migration 024: author_handle, photo, photo_alt, source; rows without a source are fetched again once by the webmention worker - Note page: a card with avatar, name, handle, text, image and date; home/tag/likes: "In reply to <author>" with a short quote - Avatars and images saved locally (CSP allows only this site's images); avatar upkeep now covers reply contexts so their avatars aren't removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
2.3 KiB
HTML
53 lines
2.3 KiB
HTML
{# One note in a list (home, tag pages). v2.3.0 #}
|
|
{% from "partials/media.html" import display_media %}
|
|
{% from "partials/reaction.html" import reaction %}
|
|
{% from "partials/reply_context.html" import reply_line %}
|
|
{% from "partials/responses.html" import list_counts %}
|
|
{% macro note_preview(note, author) %}
|
|
<article class="h-entry note-preview">
|
|
{# Titled notes are articles (ADR-076) #}
|
|
{% if note.title %}
|
|
<h2 class="p-name"><a href="{{ note.url }}">{{ note.title }}</a></h2>
|
|
{% endif %}
|
|
|
|
{% if note.in_reply_to %}
|
|
{{ reply_line(note.in_reply_to, note.context if note.context is defined else None) }}
|
|
{% endif %}
|
|
|
|
{{ reaction(note) }}
|
|
|
|
{% if note.title %}
|
|
{# Articles: title, summary and a link through; images stay on the article page (v2.16.0).
|
|
The photos stay in the markup, unseen, so parsers read the same post type here as on the page. #}
|
|
{% for item in note.media or [] %}<data class="u-photo" value="{{ url_for('public.media_file', path=item.path) }}"></data>{% endfor %}
|
|
{% set summary = note.summary or note.excerpt %}
|
|
{% if summary.strip() %}
|
|
<div class="p-summary">
|
|
<p>{{ summary }}</p>
|
|
</div>
|
|
{% endif %}
|
|
<p class="read-more"><a href="{{ note.url }}">Read more →</a></p>
|
|
{% else %}
|
|
{{ display_media(note.media, note.excerpt|truncate(150)) }}
|
|
{# Always present, even empty: without it a text-free photo post gets an implied name (mf2) #}
|
|
<div class="e-content">
|
|
{{ note.html|safe }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<footer class="note-meta">
|
|
<a class="u-url u-uid" href="{{ note.url }}"><time class="dt-published" datetime="{{ note.created_at|iso_utc }}">{{ note.created_at.strftime('%b %-d, %Y') }}</time></a>
|
|
{% if note.tags %}
|
|
<span class="note-tags">
|
|
{% for tag in note.tags %}<a class="p-category" rel="tag" href="{{ url_for('public.tag', tag=tag.name) }}">{{ tag.display_name }}</a>{% endfor %}
|
|
</span>
|
|
{% endif %}
|
|
{{ list_counts(note.response_counts if note.response_counts is defined else None, note.url) }}
|
|
{% if author %}
|
|
{# Single-author site: keep the h-card for parsers, hide it from readers #}
|
|
<span class="p-author h-card visually-hidden"><a class="p-name u-url" href="{{ author.url or author.me }}">{{ author.name or author.url or author.me }}</a></span>
|
|
{% endif %}
|
|
</footer>
|
|
</article>
|
|
{% endmacro %}
|