Crossposting runs in a background worker; url_for there raised and every crosspost failed. post_url now joins SITE_URL and post_path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.7 KiB
Markdown
30 lines
1.7 KiB
Markdown
# v2.17.0: Article URLs and title slugs
|
|
|
|
Implements ADR-077. Follow-up to v2.16.0 (ADR-076): articles had `/note/`
|
|
URLs and timestamp slugs.
|
|
|
|
## What changed
|
|
|
|
| Area | Change |
|
|
|---|---|
|
|
| URL helpers | `utils.post_path(slug, title)` and `post_url(slug, title)`; `Note.permalink` uses them, `Note.endpoint` (`public.article`/`public.note`) and `Note.url` (absolute) are new |
|
|
| Routes | `public.article` at `/article/<slug>`; `note` and `article` share `_permalink(slug, endpoint)`, which 301s to the other route when the post's type doesn't match. `_note_was_deleted` checks both URLs for hard-deleted posts |
|
|
| Slugs | `slug_utils.generate_title_slug(title, existing)`; `create_note` uses it for titled posts without `custom_slug`, else the timestamp slug |
|
|
| Micropub | `Location`, `q=source` url via `note.url`; `_note_from_url` accepts `/article/`; update answers 201 + `Location` when a title is added or removed |
|
|
| Other URL builders | Templates (`note.url`), webmention sending (`post_url`/`note.url`), crosspost permalink, backfeed target, notification links, search results (`article_title` from `notes.title`), MCP tools |
|
|
| Webmention receiving | `resolve_target_note` accepts `/note/` and `/article/` |
|
|
|
|
## Tests
|
|
|
|
`tests/test_articles.py::TestArticleUrls`: Micropub URL and slug, timestamp
|
|
slugs for notes, redirects both ways, updates via the old URL, slug rules
|
|
(accents, duplicates, reserved, `mp-slug`, emoji, long titles), 201 on
|
|
adding/removing a title, 410 for a deleted article, webmention targets and
|
|
homepage links, search result URLs.
|
|
|
|
## v2.17.1
|
|
|
|
`post_url` first used `url_for`, which fails outside a request (the
|
|
crosspost and backfeed workers); CI caught it in `test_likes_reposts.py`
|
|
before 2.17.0 was built. It now joins `SITE_URL` and `post_path`.
|