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>
2.4 KiB
2.4 KiB
v2.3.3: Micropub titles, q=source URL, single title display
Superseded in v2.16.0 by ADR-076: titles are stored in
notes.title, not as a# Headingin the content, andsplit_titleis used only to move old headings and drop a heading that repeatsname.
Found while building tuipub, a terminal Micropub client, against StarPunk.
Problems
- Micropub
namedropped.handle_createcalledextract_title()and threw the result away. StarPunk has no title column:Note.titleis derived from the content's first line, and a# Headingfirst line marks a titled note (Q22). So anamesent by a client never showed up. q=sourceURL wrong. It built{SITE_URL}notes/{slug}, but the route is/note/<slug>, so the URL was a 404.q=sourcename wrong. It returnednote.titlefor every note. For untitled notes that is just the first line of the content, so clients saw anamethey never sent.- Title shown twice.
note.htmlrenders the title as<h1 class="p-name">and then the whole content, which includes the# Headingagain. Home-page previews did the same with the excerpt.
Decisions
- Store
nameas a# {name}first line (micropub.add_title_heading) rather than adding a title column. This matches how titled notes already work everywhere (pages, feeds, search, admin editor), and needs no migration. If the content already starts with that exact heading, it isn't added twice. models.split_title()is the single definition of "title heading": the first non-blank line starting with#(the same rule as the templates'has_explicit_title).q=sourceuses it to returnname+contentthe way they were posted.Note.body_htmlrenders the content without the title heading;note.htmluses it.Note.excerptalso leaves the title out.Note.htmlis unchanged, so feeds and syndication behave as before (feed items carry a separate title anyway).extract_title()no longer derives a fallback title from content: that value was never used.
Tests
tests/test_micropub.py: name stored as heading, no duplicate heading,q=sourceurl equals the Location permalink,nameonly for titled notes, round trip.tests/test_models.py:split_title,body_html, excerpt without title.- Checked end to end with tuipub against a local dev server: titled post → page shows the title once,
q=sourcereturnsname,contentand a working url.