SEO and i18n
Per-page title/meta/Open Graph/JSON-LD, and translations with t().
seo{}
export const seo = {
title: `${data.name} | Mi Tienda`,
description: data.description,
canonical: `/products/${params.slug}`,
openGraph: { title: data.name, image: data.image },
twitter: { card: "summary_large_image" }
};Per-page title/description/canonical/Open Graph/Twitter card. Each field is a string, a template, or t("...") — never a function. A field that can't resolve gets omitted, never filled in halfway.
schema{} — real JSON-LD
export const schema = {
type: "Product",
name: data.name,
offers: { type: "Offer", price: data.price, priceCurrency: "USD" }
};Resolves to a real <script type="application/ld+json">. type/@type is interchangeable; an explicit @type never gets overwritten.
Automatic sitemap.xml and robots.txt
NEXA_SITE_URL=https://misitio.com nexa build
# dist/sitemap.xml y dist/robots.txt con URLs absolutas
# Sin NEXA_SITE_URL: URLs relativas + un avisonexa build generates both for every compiled static route. nexa-seo warns (NEXA-SEO-001..) if title/description/canonical is missing, or an image lacks alt — it never blocks the build.
Basic i18n: t() and [locale]
// src/locales/es.json
{ "home": { "title": "Bienvenido" } }
<h1>{t("home.title")}</h1>src/locales/<locale>.json is a flat dictionary. t("home.title") resolves against the current locale's dictionary — no fallback to another language: a missing key gets omitted (in seo) or stays inert in the body.
Interpolation in t()
// src/locales/es.json
{ "profile": { "donateTo": "Apoyar a {name}" } }
<p>{t("profile.donateTo", { name: data.creatorName })}</p>t("key", { variable: data.x }) substitutes the matching placeholder inside the dictionary text. nexa build/nexa lint fail with a clear error if a key and its arguments don't match up.
Automatic hreflang
<!-- generado solo, en <head>, para cada locale disponible -->
<link rel="alternate" hreflang="es" href="/es/products/iphone-17">
<link rel="alternate" hreflang="en" href="/en/products/iphone-17"><link rel="alternate" hreflang="..."> is generated automatically as long as the route lives under [locale] and there's more than one src/locales/*.json — nothing to write by hand.