Skip to content

CE: Per-page og:url + canonical in page_shell#308

Merged
ericflo merged 1 commit intomainfrom
ce/fix-og-url-canonical-per-page
Apr 16, 2026
Merged

CE: Per-page og:url + canonical in page_shell#308
ericflo merged 1 commit intomainfrom
ce/fix-og-url-canonical-per-page

Conversation

@ericflo
Copy link
Copy Markdown
Owner

@ericflo ericflo commented Apr 16, 2026

What

PR #307 added og:url and related meta tags through page_shell but hardcoded og:url to https://modelrelay.io/ (root) for every non-root page, and omitted <link rel="canonical"> entirely. That meant /login, /signup, /pricing, /setup, and /integrate all claimed root as their og:url and had no canonical link.

This PR threads the request path through page_shell() and page_shell_custom(), rendering per-page og:url and <link rel="canonical"> as https://modelrelay.io{path}, and updates every call site in the workspace to pass its route path.

Changes

  • modelrelay-web/src/templates.rs: page_shell and page_shell_custom now accept path: &str; render <meta property="og:url" content="https://modelrelay.io{path}"> and <link rel="canonical" href="https://modelrelay.io{path}">.
  • Updated every caller in modelrelay-web and modelrelay-cloud (routes/mod.rs, routes/auth.rs, routes/checkout.rs, routes/dashboard.rs) to pass its route path. Dynamic paths like /dashboard/keys/{id}/revoke are built via format! and threaded through helpers.
  • templates/pricing.html (served statically without page_shell): add og:url and canonical for /pricing directly.
  • templates/index.html: normalize existing og:url and canonical to https://modelrelay.io/ with trailing slash so the landing page matches the convention used by page_shell.
  • tests/http_routes.rs: new integration tests asserting /, /login, /signup, /pricing, and /checkout/cancel each render og:url and canonical containing their page path. Added a session-layer helper so session-dependent routes render rather than 503.

Title, description, og:title, og:description, and twitter:* tags are left untouched.

Validation

  • cargo test -p modelrelay-cloud -p modelrelay-web — 64 tests pass
  • cargo fmt --check — clean
  • cargo clippy -p modelrelay-cloud -p modelrelay-web --all-targets -- -D warnings — clean

PR #307 added og:url and related meta tags through page_shell but hardcoded
og:url to https://modelrelay.io/ (root) for every non-root page, and omitted
<link rel="canonical"> entirely. That meant /login, /signup, /pricing, /setup,
and /integrate all claimed root as their og:url and had no canonical link.

- Thread request path through page_shell() and page_shell_custom(), render
  per-page og:url and canonical as https://modelrelay.io{path}.
- Update every call site across modelrelay-web and modelrelay-cloud to pass
  the route's path. Dynamic paths (e.g. /dashboard/keys/{id}/revoke) are
  built via format!.
- Add og:url + canonical for /pricing directly to its static template.
- Update the static landing index.html to use https://modelrelay.io/ with a
  trailing slash so it matches the page_shell convention.
- Add integration tests asserting /, /login, /signup, /pricing, and
  /checkout/cancel each render og:url and canonical containing their path.
@ericflo ericflo merged commit 8ee56cc into main Apr 16, 2026
12 checks passed
@ericflo ericflo deleted the ce/fix-og-url-canonical-per-page branch April 16, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant