Skip to content

Per-route OG metadata via Cloudflare meta-injector#143

Merged
anderdc merged 3 commits into
testfrom
feat/og-metadata
Jul 14, 2026
Merged

Per-route OG metadata via Cloudflare meta-injector#143
anderdc merged 3 commits into
testfrom
feat/og-metadata

Conversation

@e35ventura

@e35ventura e35ventura commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

What

Dynamic link previews: sharing a swap URL now produces a card for that specific transaction instead of the generic brand image.

  • .cloudflare/cloudflare-worker-meta-injector.js (new): Cloudflare Worker for the all-ways.io zone, same architecture as gittensor-ui's injector. For HTML requests it rewrites <title>, og:*, and twitter:* per route:
    • /swap/:swapId → title "0.10 SOL to 0.12 TAO", description "Transaction #28 · Completed in 27 seconds. The native asset, settled on the destination chain. Delivery guaranteed on Allways, Bittensor Subnet 7.", og:imageapi.all-ways.io/og-image?type=swap&id=... (companion PR: entrius/das-allways#58)
    • everything else → brand card
  • index.html: static fallback titles are now just "Allways" — the og image carries the tagline
  • public/og/allways-og.png: regenerated to the new minimal brand card; template html updated to match

Before / After

Before — every URL shared the same static card:

After — swap links get their own card (title: 0.00015963 BTC to 0.102 SOL):

After — homepage and all other routes (title: Allways):

Wording notes

  • Titles use plain "to", not "→": platforms render title text in their own fonts and U+2192 tofu-boxes on some
  • No "| Allways" title suffix: og:site_name and the domain line already carry the brand

Deploy

  1. Merge + deploy das-allways#58 first (the worker's og:image URLs point at it)
  2. Create the worker on the all-ways.io Cloudflare zone with route all-ways.io/* (for test.all-ways.io, flip the two consts at the top to the test hosts)

Until the worker is live, the site keeps working exactly as today — the static tags in index.html are the crawler fallback.

Testing

Verified with a local harness: real index.html through injectMetaTags() for /, /dashboard, and a live swap id against the prod API; all tag rewrites confirmed. Card renders checked at full size and 250px chat-thumbnail scale.

e35ventura and others added 3 commits July 10, 2026 10:40
…ptions

Social crawlers don't execute JS, so the react-helmet tags never reached
them — index.html had only a relative og:image pointing at the old mesh art,
and shares rendered as bare links. The static head now carries the full
og:*/twitter:* set with absolute URLs.

The share card (/og/allways-og.png, 1200x630) is rendered in the brand
language — η badge, "Any asset / to any asset.", circle line-work — from a
committed HTML template (allways-og.template.html) using the site's own
fonts, so it can be regenerated or extended per page.

Titles and descriptions move to the new positioning: "Allways — Any asset to
any asset" with the card's own subline as the description ("Choose what you
send, what arrives, and where it lands. Delivery guaranteed."), mirrored in
SEO.tsx's default image, the landing page, and the PWA manifest. The now
unreferenced public/hero mesh art (~900KB) and its dead preload are removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- .cloudflare/cloudflare-worker-meta-injector.js: rewrites title/og/twitter
  tags per route for crawlers (same pattern as gittensor-ui). /swap/:swapId
  gets a title like "0.10 SOL to 0.12 TAO" (plain 'to' — U+2192 tofu-boxes
  in some platform fonts), a description with transaction number and
  finalization time, and og:image pointed at the das-allways /og-image
  endpoint. All other routes get the brand card.
- index.html: static fallback titles reduced to "Allways" — the og image
  itself carries the tagline now.
- public/og/allways-og.png: regenerated from the new minimal brand card
  (headline only); template html updated to match, with a note that the
  satori template in das-allways is now canonical.
# Conflicts:
#	index.html
#	public/og/allways-og.png
#	public/og/allways-og.template.html
@anderdc anderdc merged commit 1e1cd6f into test Jul 14, 2026
2 checks passed
@anderdc anderdc deleted the feat/og-metadata branch July 14, 2026 15:12
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.

2 participants