import type { MetadataRoute } from 'next'; import { COMING_SOON } from './config'; import { ALL_PAIRS } from './data/transformPairs'; import { STYLE_CATALOG } from './data/styleCatalog'; // Served as /sitemap.xml by Next's file convention. Crawlers (Google, // Bing, Pinterest's RSS imports, etc.) hit this to discover URLs. // While the launch gate is up the only visible page is the holding // page, so we don't advertise anything else to crawlers in that mode // (robots.ts also blocks indexing in that case). export default function sitemap(): MetadataRoute.Sitemap { const SITE = (process.env.NEXT_PUBLIC_SITE_URL || 'https://lumengesso.com').replace(/\/$/, ''); // changeFrequency / priority are hints, not guarantees — Google in // particular largely ignores them now, but Bing and other crawlers // still pay attention. Keep them honest. if (COMING_SOON) { return [{ url: `${SITE}/`, changeFrequency: 'weekly', priority: 1.0 }]; } const now = new Date(); // Image entries help the portraits show up in Google Images: the style // examples on the home page and every finished commission in the gallery. const styleImages = [...new Set(STYLE_CATALOG.map((s) => s.example))]; const galleryImages = [...new Set(ALL_PAIRS.map((p) => p.after.src))]; return [ { url: `${SITE}/`, changeFrequency: 'weekly', priority: 1.0, lastModified: now, images: styleImages }, { url: `${SITE}/gallery`, changeFrequency: 'weekly', priority: 0.9, lastModified: now, images: galleryImages }, { url: `${SITE}/reviews`, changeFrequency: 'weekly', priority: 0.6, lastModified: now }, { url: `${SITE}/studio`, changeFrequency: 'monthly', priority: 0.8, lastModified: now }, { url: `${SITE}/research`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, { url: `${SITE}/careers`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, { url: `${SITE}/privacy`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, { url: `${SITE}/terms`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, ]; }