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

+18
View File
@@ -179,12 +179,30 @@ class TestText:
assert raw[tag["index"]["byteStart"]:tag["index"]["byteEnd"]] == b"#IndieWeb"
assert tag["features"][0]["tag"] == "IndieWeb"
def test_hashtag_at_line_start_stays_a_tag(self):
"""Not turned into a heading and lost (v2.16.0)"""
assert plain_text("#indieweb is fun") == "#indieweb is fun"
assert [f["features"][0]["tag"] for f in bluesky_facets(plain_text("#indieweb is fun"))] == ["indieweb"]
def test_fragment_in_url_is_not_a_tag(self):
facets = bluesky_facets("see https://x.example/page#section and #42 too")
assert [f["features"][0]["$type"] for f in facets] == ["app.bsky.richtext.facet#link"]
class TestLifecycle:
def test_article_posts_teaser_with_its_own_card(self, app, pds):
"""An article's card is the article, even when its text links elsewhere (v2.16.0)"""
with app.test_request_context():
note = create_note(content="See [this](https://elsewhere.example/x) for more.",
title="My Article", summary="The gist.", published=True)
select_targets(note.id, ["bluesky"])
process_due()
record = only_record(pds)
permalink = f"https://blog.example.com/note/{note.slug}"
assert record["text"] == f"My Article\n\nThe gist.\n\n{permalink}"
assert record["embed"]["external"] == {
"uri": permalink, "title": "My Article", "description": "The gist."}
def test_publish_posts_with_link_card(self, app, pds):
note = publish(app, content="Hello **Bluesky**", tags=["IndieWeb"])
record = only_record(pds)