Fix relations nav_label URL bug and add rich 404 pages with headers
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m24s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m24s
The relations container-nav fragment was inserting nav_label (e.g. "calendars", "markets") as a URL path segment, generating wrong links like /the-village-hall/markets/suma/ instead of /the-village-hall/suma/. The nav_label is for display only, not URL construction. Also adds a rich 404 handler that shows site headers and post breadcrumb when a slug can be resolved from the URL path. Falls back gracefully to the minimal error page if context building fails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -78,10 +78,7 @@ def register():
|
||||
slug = (child.metadata_ or {}).get("slug", "")
|
||||
if not slug:
|
||||
continue
|
||||
nav_label = defn.nav_label or ""
|
||||
if post_slug and nav_label:
|
||||
path = f"/{post_slug}/{nav_label}/{slug}/"
|
||||
elif post_slug:
|
||||
if post_slug:
|
||||
path = f"/{post_slug}/{slug}/"
|
||||
else:
|
||||
path = f"/{slug}/"
|
||||
|
||||
Reference in New Issue
Block a user