Files
CashuMints.space/web/src/lib/site.ts
T
michilisandCursor 1c5df18e81 Improve SEO and social card wiring
Add SearchAction and optional Product JSON-LD, per-page OG images/alts, and document the og build and cache headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-21 02:17:35 +02:00

41 lines
1.9 KiB
TypeScript

/**
* Who this site is, in one place.
*
* These four values were previously spelled out again in every file that needed them
* (the GitHub URL alone appeared in four). They are also the values the `Organization`
* and `WebSite` JSON-LD is built from, and a schema that disagrees with the footer it
* sits under is worse than no schema at all, so they live here and both read from it.
*/
/** The name in the topbar, the footer, `og:site_name` and `Organization.name`. */
export const SITE_NAME = 'Cashumints.space';
/** The repository. Linked from the footer, /about, /terms and /privacy. */
export const GITHUB_URL = 'https://github.com/Azzamo-net/cashumints.space';
/** Who makes it. Credited in the footer and on /about. */
export const AZZAMO_URL = 'https://azzamo.net';
/**
* The default social card: brand, tagline and the network's stats, rendered by
* `pnpm og` into `public/og/` alongside the per-mint cards. Home, the list pages and
* any mint whose own card failed to render all point here.
*
* Relative on purpose: `Base.astro` resolves it against `Astro.site`, because an
* `og:image` that is not absolute is not a weaker signal, it is an ignored one.
* Stable filename, unlike the hashed per-mint cards, so it is served with
* `Cache-Control: max-age=3600` rather than immutable (see README).
*/
export const OG_IMAGE = '/og/default.png';
export const OG_IMAGE_WIDTH = 1200;
export const OG_IMAGE_HEIGHT = 630;
/**
* Whether a rated mint's JSON-LD also carries the review-snippet-eligible `Product`
* type (see `mintServiceNode` in schema.ts for the reasoning). On by default; set
* `SEO_PRODUCT_JSONLD=0` to fall back to the plain `Service` node on the next build.
* An env flag rather than a source edit, so the call can be reversed without a code
* change if Google's treatment of self-collected review markup shifts.
*/
export const PRODUCT_JSONLD = (process.env['SEO_PRODUCT_JSONLD'] ?? '1') !== '0';