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:
1 parent
9a0d82bab2
commit
978c13358b
44 files changed
+943
-356
No files matched your search
@@ -114,9 +114,29 @@ class TestUpdate:
|
||||
def test_replace_and_delete_name(self, app, client, h):
|
||||
url = create(client, h)
|
||||
self.update(client, h, url, replace={"name": ["Added"]})
|
||||
assert note_at(app, url).content.startswith("# Added")
|
||||
note = note_at(app, url)
|
||||
assert note.title == "Added" and not note.content.startswith("#")
|
||||
self.update(client, h, url, delete=["name"])
|
||||
assert "name" not in source(client, h, url)["properties"]
|
||||
assert note_at(app, url).title is None
|
||||
|
||||
def test_summary(self, app, client, h):
|
||||
"""summary is stored alongside content, updatable and returned by q=source (v2.16.0)"""
|
||||
url = create(client, h, name=["Title"], summary=["Short version"])
|
||||
props = source(client, h, url)["properties"]
|
||||
assert props["summary"] == ["Short version"] and props["name"] == ["Title"]
|
||||
assert self.update(client, h, url, replace={"summary": ["Shorter"]}).status_code == 204
|
||||
assert note_at(app, url).summary == "Shorter"
|
||||
assert self.update(client, h, url, delete=["summary"]).status_code == 204
|
||||
assert "summary" not in source(client, h, url)["properties"]
|
||||
|
||||
def test_article_body_may_go(self, app, client, h):
|
||||
"""A titled post may have no text, like a photo post (v2.16.0)"""
|
||||
url = create(client, h, name=["Only a title"])
|
||||
assert self.update(client, h, url, delete=["content"]).status_code == 204
|
||||
assert note_at(app, url).content == ""
|
||||
url = create(client, h)
|
||||
assert self.update(client, h, url, delete=["content"]).status_code == 400
|
||||
|
||||
def test_categories(self, app, client, h):
|
||||
url = create(client, h, category=["one", "two"])
|
||||
|
||||
Reference in new issue
Block a user