Social previews
Glyphfield renders PNG preview cards for the home page, the Studio and every docs page, and serves them to social crawlers without cookies or JavaScript.
Glyphfield renders its own link previews with next/og. Each card is a PNG on a dark canvas: the Glyphfield mark and name, a headline set in Inter Display, and a footer under a hairline rule. The right side shows real product material. The home, docs and /api/og cards show one frame of the dithered swirl shader that fills the mark in the landing hero. The Studio card shows a capture of the Design Lab over the same field.
Routes
| Route | Size | Card |
|---|---|---|
/opengraph-image | 1200 × 630 | Home |
/twitter-image | 1200 × 600 | Home, at the 2:1 ratio X uses for large cards |
/studio/opengraph-image | 1200 × 630 | Studio |
/studio/twitter-image | 1200 × 600 | Studio, at 2:1 |
/og/docs/{slug}/image.png | 1200 × 630 | One documentation page |
/api/og-home | 1200 × 630 | Home, the same image as /opengraph-image |
/api/og | 1200 × 630 | Built from query parameters |
The file-based routes are prerendered at build time, and Next.js writes their og:image and twitter:image tags with the size and alt text each route exports.
Layout
The headline is the largest text on every card. The typesetter tries sizes from 96 px down to 52 px, balances the line lengths, and keeps the largest size at which the title fits the left column in two lines, as long as that size is at least 72 px. Otherwise it keeps the largest size that fits in three lines, and a longer title gets more lines at the largest size at which they fit. On the home card the phrase "the whole brand." starts its own line in violet, as it does on the landing page.
A docs card uses the page title as its headline. The footer names the page's sidebar section, such as Studio · Design Lab, and its address under glyphfield.com/docs.
The cards use static cuts of Inter, because next/og cannot read Inter Variable: Inter Display SemiBold for headlines and Inter Regular and Medium for the other text. next/og places words by their unkerned width, so the typesetter measures each word with the font's own kerning and corrects its position. Run python3 scripts/generate-og-assets.py to rebuild the fonts, their metrics and the Studio capture in public/og/.
Crawler access
/robots.txt is generated by src/app/robots.ts. It allows the preview routes for Twitterbot and the Facebook, LinkedIn, Discord, Slack, Telegram, and Pinterest link-preview crawlers. Keep the following Twitter block when changing the crawler policy:
User-Agent: Twitterbot
Allow: /
Allow: /api/og
Allow: /api/og-home
Allow: /opengraph-image
Allow: /twitter-imageAn Allow rule does not create an image endpoint. The route must return a successful image/png response without authentication, cookies, JavaScript, or browser-only state.
Verification
Before deploying, check all three layers:
- Fetch
/robots.txtwith the crawler user agent and confirm the image path is allowed. - Inspect the page HTML for absolute
og:imageandtwitter:imagevalues. - Fetch that exact image URL and confirm a
200response withcontent-type: image/png.
Social networks cache previews independently. A correct redeploy may still require the network's card debugger or a versioned image URL before the old card disappears.
Dynamic preview endpoint
GET /api/og returns a 1200 × 630 PNG in the same layout. It accepts these query parameters. A title or description over its limit ends at its last whole word with an ellipsis.
| Parameter | Limit | Default | Use |
|---|---|---|---|
title | 84 characters | One studio for the whole brand. | Headline |
description | 180 characters | Build identity systems, motion, graphics, and product-ready artifacts in one connected workspace. | Up to three lines under the headline; longer text ends with an ellipsis |
url | 80 characters | glyphfield.com | Right side of the footer |
accent | #RRGGBB | #7058FF | Colors of the dithered field |
These routes are Glyphfield's own site previews. Brand OpenGraph images are made in the OpenGraph tool.
Version compatibility
Identify the API, CanvasDocument, Design Lab, saved-design and Lottie version numbers, and migrate older source without losing newer state.
Keyboard shortcuts
Find every keyboard shortcut in the Glyphfield Studio, its canvas tools, the source drawer and the documentation, with the focus each one needs.