Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 2 min read

How I Built a 12-Language HTML5 Gaming Portal with Next.js 15 SSG & 3,599 Indexable Pages

Mobile casual apps routinely demand 300 MB of storage and mandatory logins just for a five-minute puzzle round. I built YoGames to ship 261+ instant-play HTML5 browser games across 29 genres and 12 native languages with

Mobile casual apps routinely demand 300 MB of storage and mandatory logins just for a five-minute puzzle round. I built YoGames to ship 261+ instant-play HTML5 browser games across 29 genres and 12 native languages with 0 MB installed and fast static HTML delivery on Vercel.

Architecture Overview

  • Framework: Next.js 15 App Router (TypeScript + Tailwind CSS)
  • Pre-rendered + ISR Scale: 958 statically pre-rendered core pages at build time plus 24-hour CDN ISR covering 3,599 indexable URLs across 12 languages.
  • Native RTL + LTR Route Groups: Separate root layouts ((en)/layout.tsx and [lang]/layout.tsx) emit true server-rendered <html lang="ar" dir="rtl"> for Arabic alongside fr, es, pt, de, ru, hi, vi, it, tr, and id.
  • Structured Data Stack: Every game page ships VideoGame, HowTo, FAQPage, and BreadcrumbList JSON-LD schemas so search engines and AI assistants can parse controls, difficulty, and gameplay steps cleanly.

Multilingual Sitemap & hreflang Generation

One tricky part of multi-language SEO in Next.js App Router is generating bidirectional hreflang links plus x-default across thousands of URLs. Using src/app/sitemap.ts with Next.js's built-in alternates.languages map generates 45,864+ <xhtml:link rel="alternate" hreflang="..."> entries automatically in XML:

export function buildHreflangMap(path: string): Record<string, string> {
  const clean = path.startsWith("/") ? path : `/${path}`;
  const map: Record<string, string> = {};
  for (const loc of LOCALES) {
    const p = loc === "en" ? clean : clean === "/" ? `/${loc}` : `/${loc}${clean}`;
    map[loc] = `https://yogames.online${p === "/" ? "" : p}`;
  }
  map["x-default"] = `https://yogames.online${clean === "/" ? "" : clean}`;
  return map;
}

Highlights Live on YoGames

If you want to test the latency, RTL mirroring, or game pages directly:

Indexing Checklist That Worked on Day 1

  1. Submitted both /sitemap.xml and /feed.xml (RSS 2.0) to Google Search Console and Bing Webmaster Tools.
  2. Added /llms.txt at the root for AI search crawlers.
  3. Triggered IndexNow right after deploy to notify Bing, DuckDuckGo, and Yandex across all 12 locale prefixes.

Happy to answer questions about Next.js App Router multi-root RTL layouts, ISR caching budgets, or HTML5 game embedding!

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.