feat: article titles and summaries stored apart from the text (v2.16.0, ADR-076)

Articles as the IndieWeb defines them: a name separate from the content.

- Migration 023 adds notes.title and notes.summary. A one-time Python data
  step (migrations.DATA_MIGRATIONS) moves each note's '# Heading' first line
  into title, rewrites the file and hash, empties FTS for a rebuild, and puts
  files back if the migration fails. Trashed notes included.
- Micropub: name -> title, summary stored when sent with content, summary
  updatable, q=source returns both. MCP tools take a summary.
- Feeds: titles only for articles (RSS/JSON none, Atom empty); Atom and
  JSON Feed summaries; the title is no longer repeated in the content.
- Pages: p-name/p-summary on the article page. Homepage and tag pages show
  articles as title, summary and "Read more" without images (hidden u-photo
  keeps the post type for parsers).
- Crossposts: articles go out as title, summary, link and hashtags, no
  images; the Bluesky card is the article. Notes unchanged.
- Editor: Title and Summary fields; an article may have no body.
- Fix: a line starting with a hashtag ('#indieweb ...') was rendered as a
  heading and crossposted without its '#' (HashtagLineExtension).
- Fix: excerpts showed raw Markdown; they are plain text now.

Back up the database and the data folder before deploying: the migration
rewrites note files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-11 17:05:38 -07:00
1 parent 9a0d82bab2
commit 978c13358b
44 files changed
+943 -356

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@
<tr>
<td class="note-content-preview">
<div class="note-excerpt">
{{ note.content[:100] }}{% if note.content|length > 100 %}...{% endif %}
{% if note.title %}<strong>{{ note.title }}</strong>{% else %}{{ note.content[:100] }}{% if note.content|length > 100 %}...{% endif %}{% endif %}
</div>
<small class="note-slug">{{ note.slug }}</small>
</td>
+13 -1
View File
@@ -11,6 +11,12 @@
</p>
<form action="{{ url_for('admin.update_note_submit', note_id=note.id) }}" method="POST" class="note-form"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="title">Title (optional)</label>
<input type="text" id="title" name="title" value="{{ note.title or '' }}" maxlength="200"
placeholder="Leave blank for a note; a title makes it an article">
</div>
<div class="form-group">
{% if note.reacts_to %}
<p class="note-meta">{{ {'like': '★ Like of', 'repost': '🔁 Repost of', 'bookmark': '🔖 Bookmark of'}[note.kind] }} <a href="{{ note.reacts_to }}">{{ note.reacts_to }}</a></p>
@@ -20,12 +26,18 @@
id="content"
name="content"
rows="{{ 6 if note.reacts_to else 20 }}"
{% if not note.reacts_to %}required{% endif %}
autofocus
>{{ note.content }}</textarea>
<small>Use Markdown syntax for formatting</small>
</div>
<div class="form-group">
<label for="summary">Summary (optional)</label>
<textarea id="summary" name="summary" rows="2"
placeholder="A sentence or two for the homepage, feeds and crossposts">{{ note.summary or '' }}</textarea>
<small>Articles only. Leave blank to use the start of the text.</small>
</div>
<div class="form-group">
<label for="slug">Slug (permanent)</label>
<input type="text"
+13 -1
View File
@@ -7,6 +7,12 @@
<h2>Create New Note</h2>
<form action="{{ url_for('admin.create_note_submit') }}" method="POST" enctype="multipart/form-data" class="note-form"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="title">Title (optional)</label>
<input type="text" id="title" name="title" value="" maxlength="200"
placeholder="Leave blank for a note; a title makes it an article">
</div>
<div class="form-group">
<label for="content">Content (Markdown)</label>
<textarea
@@ -14,12 +20,18 @@
name="content"
rows="20"
placeholder="Write your note in markdown..."
required
autofocus
></textarea>
<small>Use Markdown syntax for formatting</small>
</div>
<div class="form-group">
<label for="summary">Summary (optional)</label>
<textarea id="summary" name="summary" rows="2"
placeholder="A sentence or two for the homepage, feeds and crossposts"></textarea>
<small>Articles only. Leave blank to use the start of the text.</small>
</div>
<div class="form-group">
<label for="custom_slug">Custom Slug (optional)</label>
<input type="text"
+7 -7
View File
@@ -3,17 +3,17 @@
{% 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.bookmark_of %}Bookmark{% elif note.in_reply_to %}Reply{% else %}Photo{% endif %} · {{ config.SITE_NAME }}{% endblock %}
{% block title %}{% if note.title %}{{ note.title }}{% elif note.excerpt.strip() %}{{ note.excerpt|truncate(60) }}{% elif note.repost_of %}Repost{% elif note.like_of %}Like{% elif note.bookmark_of %}Bookmark{% 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 %}
{# Titled notes are articles: p-name only then, so notes get no implied name (ADR-076) #}
{% if note.title %}
<h1 class="p-name">{{ note.title }}</h1>
{% endif %}
{% if note.summary %}
<p class="p-summary">{{ note.summary }}</p>
{% endif %}
{# Reply context (v1.6.0 Phase 4) - displayed if this is a reply post #}
{% if note.in_reply_to %}
@@ -49,7 +49,7 @@
{# e-content: note content BELOW media (per ADR-057) #}
<div class="e-content">
{{ note.body_html|safe }}
{{ note.html|safe }}
</div>
<footer class="note-meta">
+11 -8
View File
@@ -4,9 +4,8 @@
{% from "partials/responses.html" import list_counts %}
{% macro note_preview(note, author) %}
<article class="h-entry note-preview">
{# Notes starting with a '# Heading' have a title (Q22; Note.has_title) #}
{% set has_explicit_title = note.has_title %}
{% if has_explicit_title %}
{# Titled notes are articles (ADR-076) #}
{% if note.title %}
<h2 class="p-name"><a href="{{ absolute_url_for('public.note', slug=note.slug) }}">{{ note.title }}</a></h2>
{% endif %}
@@ -16,15 +15,19 @@
{{ reaction(note) }}
{{ display_media(note.media, note.excerpt|truncate(150)) }}
{% if has_explicit_title %}
{# Titled notes are articles: show a summary and link through #}
{% 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>{{ note.excerpt }}</p>
<p>{{ summary }}</p>
</div>
{% endif %}
<p class="read-more"><a href="{{ absolute_url_for('public.note', slug=note.slug) }}">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 }}