- Responses as u-comment/u-like/u-repost/u-bookmark/u-mention h-cites with author h-cards; source's own url and published (migration 014) - dt-* and Micropub published in RFC 3339 UTC - Title only for a real Markdown heading (hashtag notes stay notes) - Ignore webmentions from a note's own syndicated copies - Micropub/IndieAuth links independent of Webmention; rel=me/rel=author - Representative h-card and authorship algorithm (starpunk/mf2_utils.py) - Tag/likes h-feeds get url and author; previews get u-uid Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
128 lines
5.3 KiB
HTML
128 lines
5.3 KiB
HTML
{% extends "base.html" %}
|
|
{% from "partials/media.html" import display_media %}
|
|
{% from "partials/reaction.html" import reaction %}
|
|
{% import "partials/responses.html" as responses with context %}
|
|
|
|
{% block title %}{% if note.has_title %}{{ note.title }}{% elif note.excerpt.strip() %}{{ note.excerpt|truncate(60) }}{% elif note.repost_of %}Repost{% elif note.like_of %}Like{% elif note.in_reply_to %}Reply{% else %}Photo{% endif %} · {{ config.SITE_NAME }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<article class="h-entry">
|
|
{# Notes starting with a '# Heading' have a title (Q22; Note.has_title) #}
|
|
{% set has_explicit_title = note.has_title %}
|
|
|
|
{# p-name only if note has explicit title (per Q22) #}
|
|
{% if has_explicit_title %}
|
|
<h1 class="p-name">{{ note.title }}</h1>
|
|
{% endif %}
|
|
|
|
{# Reply context (v1.6.0 Phase 4) - displayed if this is a reply post #}
|
|
{% if note.in_reply_to %}
|
|
<div class="reply-context">
|
|
<span class="reply-label">In reply to:</span>
|
|
{# u-in-reply-to on the h-cite itself makes it the entry's property (Post Type Discovery) #}
|
|
<blockquote class="u-in-reply-to h-cite">
|
|
{% if reply_context and reply_context.fetch_status == 'fetched' %}
|
|
{% if reply_context.content_snippet %}
|
|
<p class="p-content">{{ reply_context.content_snippet }}</p>
|
|
{% endif %}
|
|
<cite>
|
|
<a class="u-url" href="{{ note.in_reply_to }}">
|
|
{% if reply_context.author_name %}{{ reply_context.author_name }}{% endif %}
|
|
{% if reply_context.site_name %} on {{ reply_context.site_name }}{% endif %}
|
|
{% if not reply_context.author_name and not reply_context.site_name %}{{ note.in_reply_to }}{% endif %}
|
|
</a>
|
|
</cite>
|
|
{% else %}
|
|
<cite>
|
|
<a class="u-url" href="{{ note.in_reply_to }}">{{ note.in_reply_to }}</a>
|
|
</cite>
|
|
{% endif %}
|
|
</blockquote>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{{ reaction(note) }}
|
|
|
|
{# u-photo placement: Per draft spec, u-photo must be direct child of h-entry, #}
|
|
{# NOT inside e-content. Media is rendered ABOVE e-content to meet this requirement. #}
|
|
{{ display_media(note.media, note.excerpt|truncate(150)) }}
|
|
|
|
{# e-content: note content BELOW media (per ADR-057) #}
|
|
<div class="e-content">
|
|
{{ note.body_html|safe }}
|
|
</div>
|
|
|
|
<footer class="note-meta">
|
|
{# u-url and u-uid same for notes (per Q23) #}
|
|
<a class="u-url u-uid" href="{{ absolute_url_for('public.note', slug=note.slug) }}"><time class="dt-published" datetime="{{ note.created_at|iso_utc }}">{{ note.created_at.strftime('%B %-d, %Y · %-I:%M %p') }}</time></a>
|
|
{% if note.updated_at and note.updated_at != note.created_at %}
|
|
<span class="updated">Updated <time class="dt-updated" datetime="{{ note.updated_at|iso_utc }}">{{ note.updated_at.strftime('%b %-d, %Y') }}</time></span>
|
|
{% endif %}
|
|
{# rel="tag" per microformats2 p-category #}
|
|
{% 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 %}
|
|
{% set synced = (syndications or [])|selectattr('remote_url')|list %}
|
|
{% if synced %}
|
|
<span class="syndication">Also on {% for s in synced %}<a class="u-syndication" href="{{ s.remote_url }}" rel="syndication">{{ s.name }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</span>
|
|
{% endif %}
|
|
{# Author h-card (nested within h-entry per Q20); hidden on a single-author site #}
|
|
{% if author %}
|
|
<span class="p-author h-card visually-hidden">
|
|
{% if author.photo %}<img class="u-photo" src="{{ author.photo }}" alt="">{% endif %}
|
|
<a class="p-name u-url" href="{{ author.url or author.me }}">{{ author.name or author.url or author.me }}</a>
|
|
{% if author.note %}<span class="p-note">{{ author.note }}</span>{% endif %}
|
|
</span>
|
|
{% endif %}
|
|
</footer>
|
|
|
|
<nav class="note-nav">
|
|
<a href="/">← All notes</a>
|
|
</nav>
|
|
|
|
{# Webmentions section (v1.6.0 Phase 5) - only shown if approved webmentions exist #}
|
|
{% if webmentions %}
|
|
<section class="webmentions">
|
|
<h2>Responses</h2>
|
|
|
|
{% if replies %}
|
|
<div class="webmention-group webmention-replies">
|
|
<h3>{{ replies|length }} {{ 'Reply' if replies|length == 1 else 'Replies' }}</h3>
|
|
{% for wm in replies %}{{ responses.reply(wm) }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if likes %}
|
|
<div class="webmention-group webmention-likes">
|
|
<h3>{{ likes|length }} {{ 'Like' if likes|length == 1 else 'Likes' }}</h3>
|
|
{{ responses.facepile(likes, 'u-like') }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if reposts %}
|
|
<div class="webmention-group webmention-reposts">
|
|
<h3>{{ reposts|length }} {{ 'Repost' if reposts|length == 1 else 'Reposts' }}</h3>
|
|
{{ responses.facepile(reposts, 'u-repost') }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if bookmarks %}
|
|
<div class="webmention-group webmention-bookmarks">
|
|
<h3>{{ bookmarks|length }} {{ 'Bookmark' if bookmarks|length == 1 else 'Bookmarks' }}</h3>
|
|
{{ responses.facepile(bookmarks, 'u-bookmark') }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if mentions %}
|
|
<div class="webmention-group webmention-mentions">
|
|
<h3>{{ mentions|length }} {{ 'Mention' if mentions|length == 1 else 'Mentions' }}</h3>
|
|
{% for wm in mentions %}{{ responses.mention(wm) }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</section>
|
|
{% endif %}
|
|
</article>
|
|
{% endblock %}
|