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

+10 -2
View File
@@ -73,6 +73,7 @@ def _summary(note) -> dict:
"url": _note_url(note.slug),
"slug": note.slug,
"title": note.title,
"summary": note.summary,
"kind": note.kind,
"status": "published" if note.published else "draft",
"published": iso_utc(note.created_at),
@@ -217,6 +218,7 @@ def register_tools(server: MCPServer, app: Flask) -> None:
async def create_note(
content: str = "",
title: Optional[str] = None,
summary: Optional[str] = None,
tags: Optional[list[str]] = None,
draft: bool = True,
photos: Optional[list[Photo]] = None,
@@ -230,7 +232,8 @@ def register_tools(server: MCPServer, app: Flask) -> None:
) -> dict:
"""Create a note (Markdown). It is a draft unless draft is false;
publishing makes it public and crossposts it to the syndicate_to
targets. A title makes it an article. At most one of like_of,
targets. A title makes it an article; summary is its short summary,
shown on the homepage and in feeds and crossposts. At most one of like_of,
repost_of and bookmark_of. published_at is an ISO 8601 date."""
info = _token_info()
_require(info, "create", "draft")
@@ -240,6 +243,8 @@ def register_tools(server: MCPServer, app: Flask) -> None:
props["content"] = [content]
if title:
props["name"] = [title]
if summary:
props["summary"] = [summary]
if tags:
props["category"] = list(tags)
if photos:
@@ -268,6 +273,7 @@ def register_tools(server: MCPServer, app: Flask) -> None:
url: str,
content: Optional[str] = None,
title: Optional[str] = None,
summary: Optional[str] = None,
tags: Optional[list[str]] = None,
add_tags: Optional[list[str]] = None,
remove_tags: Optional[list[str]] = None,
@@ -276,7 +282,7 @@ def register_tools(server: MCPServer, app: Flask) -> None:
in_reply_to: Optional[str] = None,
) -> dict:
"""Change a note. Only the fields given change: content replaces the
text, title replaces the title ("" removes it), tags replaces all
text, title replaces the title ("" removes it), summary likewise, tags replaces all
tags, add_tags/remove_tags adjust them, photos replaces all photos,
draft false publishes a draft (and crossposts it) and true unpublishes.
Edits to published notes follow to their crossposts."""
@@ -288,6 +294,8 @@ def register_tools(server: MCPServer, app: Flask) -> None:
replace["content"] = [content]
if title is not None:
replace["name"] = [title]
if summary is not None:
replace["summary"] = [summary]
if tags is not None:
replace["category"] = list(tags)
if draft is not None: