feat: articles at /article/<slug> with slugs from their titles (v2.17.0, ADR-077)
Articles (notes with a title) move from /note/<slug> to /article/<slug>; the other prefix 301-redirects. New articles take their slug from the title (mp-slug still wins; notes keep timestamp slugs). A Micropub update that adds or removes a title answers 201 with the new Location. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
66aecc2bcb
commit
b7f8e1612c
26 files changed
+308
-60
No files matched your search
@@ -716,6 +716,16 @@ def absolute_url_for(endpoint: str, **values) -> str:
|
||||
return current_app.config["SITE_URL"].rstrip("/") + url_for(endpoint, **values)
|
||||
|
||||
|
||||
def post_path(slug: str, title: Optional[str] = None) -> str:
|
||||
"""A post's URL path: /article/<slug> when it has a title, else /note/<slug> (v2.17.0)"""
|
||||
return f"/{'article' if title else 'note'}/{slug}"
|
||||
|
||||
|
||||
def post_url(slug: str, title: Optional[str] = None) -> str:
|
||||
"""A post's absolute URL (see post_path)"""
|
||||
return absolute_url_for("public.article" if title else "public.note", slug=slug)
|
||||
|
||||
|
||||
def iso_utc(value) -> str:
|
||||
"""
|
||||
Format a timestamp as RFC 3339 UTC for dt-* and Micropub (v2.8.0)
|
||||
|
||||
Reference in new issue
Block a user