logo
Get in touch

SEO (search & social)

Configure site URL, Open Graph defaults, robots, and per-page titles in messages.

SEO is split into two places:

  1. config/seo.ts — global, non-translated settings (production URL, default share image, Twitter handles, robots, Google verification).
  2. config/messages/<locale>.jsonMetadata — translated titles, descriptions, and keywords for each route.

Next.js merges the locale layout metadata (defaults + metadataBase) with each page generateMetadata output. Canonical URLs and hreflang alternates are built from seo.siteUrl and your configured locales (en, es).

config/seo.ts

FieldPurpose
siteUrlProduction origin without a trailing slash, e.g. https://yourdomain.com. Used for metadataBase, Open Graph url, and canonical links.
defaultOgImagePath under public/ for shared previews when a page does not set its own image (default: /hero_bg.png).
openGraphTypeUsually website.
twitterCardUsually summary_large_image.
twitterSite / twitterCreatorOptional X (Twitter) handles, e.g. @YourBrand.
robotsDefault indexing rules (index / follow and googleBot).
googleSiteVerificationOptional HTML tag token from Google Search Console.

After changing siteUrl, redeploy so metadata points at the real domain.

Metadata in locale JSON

Under Metadata in config/messages/en.json and config/messages/es.json:

  • siteName — Application / OG site name.
  • titleTemplate — Pattern for inner pages, e.g. %s \| Sifo. The home page uses defaultTitle as the full title without going through the template.
  • defaultTitle, defaultDescription, defaultKeywords — Home page and fallbacks. Keywords are a comma-separated string.
  • pages.<key>.title, pages.<key>.description, pages.<key>.keywords — Static routes such as about, games, knowledgebase, faq, etc.

Edit the same keys in both en.json and es.json so each language ranks and shares correctly.

Dynamic pages

These take titles and descriptions from content, not from Metadata.pages:

  • Game routes (/games/[slug]) — use the game’s name and description from config/games/*.json; Open Graph image uses the game backgroundImage.
  • Cloud products (/vps, /website, /dedicated) — use localized name and description from config/cloud/*.json.
  • Knowledgebase — category pages use category name, description, and image; article pages use the article frontmatter title and description, with og:type set to article.

Files involved in code

  • lib/seo-metadata.ts — builds alternates, Open Graph, and Twitter fields.
  • lib/cloud-product-metadata.ts — cloud product pages.
  • app/[locale]/layout.tsx — calls createRootLayoutMetadata for global defaults.

If you add a new static route, register it in staticSeoPaths inside lib/seo-metadata.ts and add matching pages.<key> entries under Metadata in both locale files.