Skip to content

v0.1.3 — link previews and canonical

Choose a tag to compare

@NiKrause NiKrause released this 30 Jul 17:41
18e4cc6

A demo-only release. The published package is unchanged@le-space/libp2p-webrtc-qr@0.1.0 remains current on npm, and nothing in packages/webrtc-qr moved.

Live: https://webrtc-qr.le-space.de

Link previews

Sharing the demo anywhere — Mastodon, Slack, LinkedIn, a mail — produced a bare link with no image and no description. For a page whose entire purpose is being shown to people, that was the largest piece of wasted reach.

It now ships Open Graph and Twitter card tags plus a 1200×630 card built from the Le-Space tokens. The QR on the card is a real code that resolves to the demo, verified by decoding the rendered PNG — so it still works when someone points a phone at a screenshot of the card.

The card is checked in rather than generated during the build: a social image should change when someone decides it should, not as a side effect of a deploy. pnpm og-image regenerates it.

A canonical URL

Not boilerplate in this case. The identical build is served from webrtc-qr.le-space.de and from every IPFS gateway that resolves the CID — real duplicate content across a dozen hosts, which is exactly what canonical exists for.

Image URLs are absolute for a related reason: a crawler that found the page under /ipfs/<cid>/ resolves a relative asset to a path that does not exist there, and the preview fails silently.

Deliberately not included

sitemap.xml, robots.txt and JSON-LD structured data. Traffic here comes from the repo, npm, the landing page and shared links — search volume for this topic is negligible, so ranking markup would be effort with optics rather than effect.

Tests

31 tests gating the deploy: 18 unit, 11 browser end-to-end (five new), 2 Helia.

The new specs check what actually breaks in practice rather than that tags exist:

  • the declared image ships in the build and returns image/png
  • its real pixel dimensions, read from the PNG header, match the declared width and height — and are at least 1200×630, below which the large card degrades to a thumbnail
  • no image URL is relative, and og:url agrees with the canonical

A meta tag pointing at a deleted asset errors nowhere. It stays invisible until someone shares a link and gets a blank card.

Full changes in #5.