(feat) Discord build share
This commit is contained in:
@@ -187,6 +187,40 @@ boundary. An owned Build page links to `/guides/new?build=<id>`, where the
|
||||
server verifies ownership and initializes a removable Build block in a new
|
||||
private Guide.
|
||||
|
||||
### Discord-compatible Build sharing experiment
|
||||
|
||||
Persisted public and unlisted Builds expose absolute Open Graph metadata for
|
||||
their canonical `/builds/[slug]` URL. Their `og:image` and Twitter card metadata
|
||||
reference the same-origin 1200 × 630 PNG at `/builds/[slug]/preview.png` so
|
||||
Discord and other link unfurlers can render a Build summary. Private Builds set
|
||||
`noindex,nofollow`, expose no crawler image, and provide no usable sharing
|
||||
control.
|
||||
|
||||
The preview endpoint derives its image from canonical Build facts and the
|
||||
current known-stat summary in the shared Build projection. It includes the Build
|
||||
title, author, visibility, direct URL, equipped weapon names, core totals, and
|
||||
up to three supporting Attributes. The renderer performs no external fetches. It
|
||||
normalizes and bounds every text field by grapheme count, escapes text before
|
||||
inserting it into XML, builds a text-only SVG, and rasterizes that SVG to PNG
|
||||
with Sharp. Production installs DejaVu Sans from the Debian package and the
|
||||
renderer names that fixed family explicitly.
|
||||
|
||||
The endpoint hashes a versioned serialization of the image input for its bounded
|
||||
in-process render cache and derives the HTTP ETag from the resulting PNG bytes.
|
||||
A bounded request queue limits concurrent database projections and Sharp work.
|
||||
Responses require cache revalidation so a visibility change to Private blocks
|
||||
the next request instead of leaving a stale response window. Matching
|
||||
conditional requests receive `304 Not Modified`. Private, missing, and
|
||||
inaccessible Builds receive no preview. Unlisted images send the
|
||||
`X-Robots-Tag: noindex` response header.
|
||||
|
||||
For eligible Builds, the Build Uplink invokes the native Web Share API as the
|
||||
primary action when the browser supports it. An explicit Copy Link action
|
||||
remains available for every public or unlisted persisted Build. This experiment
|
||||
does not install a Discord bot, post to Discord, extend Discord OAuth scopes, or
|
||||
store Discord tokens or webhooks. Discord receives only a link that an Agent
|
||||
chooses to share and may fetch the public metadata and same-origin preview.
|
||||
|
||||
## Public data corrections and discussion
|
||||
|
||||
Every public database card links to its canonical ISAC record with an exact
|
||||
|
||||
Reference in New Issue
Block a user