fix(17): CR-01 ignore an item URL pattern override that is not a path

signpost.Registry.Pattern now takes an item override only when it starts
with a single "/" and holds no surrounding whitespace or control
characters (signpost.ValidItemPattern); a javascript: URL or a
protocol-relative //host falls through to the next layer.
This commit is contained in:
2026-10-12 21:25:30 +02:00
parent d3a7f798f0
commit 964f1a7f11
4 changed files with 50 additions and 2 deletions

View File

@@ -111,6 +111,8 @@ Headless sites decide their own URLs, so a type's URL comes from a pattern in la
3. For a list type with `PatternFrom`, the host's override of the record type it lists.
4. The type's `DefaultPattern`.
An item override that is not a path is ignored: it must start with a single `/` and hold no surrounding whitespace or control characters (`signpost.ValidItemPattern`). A `javascript:` URL or a protocol-relative `//host` in a stored menu entry or sitemap row therefore falls through to the next layer instead of reaching the resolved URL.
Layer 3 is why a list type declares `PatternFrom`. A host that moves posts to `/news/:slug` sets that once, for `acme-post`, and the children of "all posts" follow, because `acme-all-posts` names `acme-post` and has no override of its own. Give a list type the same `DefaultPattern` as the type it lists, so both agree without any host configuration.
The host application sets its overrides in `config/menu_items.yaml`: