Lumen & Gesso / website · lumengesso.com / app / sitemap.ts
| 1 | import type { MetadataRoute } from 'next'; |
| 2 | import { COMING_SOON } from './config'; |
| 3 | import { ALL_PAIRS } from './data/transformPairs'; |
| 4 | import { STYLE_CATALOG } from './data/styleCatalog'; |
| 5 | |
| 6 | // Served as /sitemap.xml by Next's file convention. Crawlers (Google, |
| 7 | // Bing, Pinterest's RSS imports, etc.) hit this to discover URLs. |
| 8 | // While the launch gate is up the only visible page is the holding |
| 9 | // page, so we don't advertise anything else to crawlers in that mode |
| 10 | // (robots.ts also blocks indexing in that case). |
| 11 | export default function sitemap(): MetadataRoute.Sitemap { |
| 12 | const SITE = (process.env.NEXT_PUBLIC_SITE_URL || 'https://lumengesso.com').replace(/\/$/, ''); |
| 13 | // changeFrequency / priority are hints, not guarantees — Google in |
| 14 | // particular largely ignores them now, but Bing and other crawlers |
| 15 | // still pay attention. Keep them honest. |
| 16 | |
| 17 | if (COMING_SOON) { |
| 18 | return [{ url: `${SITE}/`, changeFrequency: 'weekly', priority: 1.0 }]; |
| 19 | } |
| 20 | |
| 21 | const now = new Date(); |
| 22 | // Image entries help the portraits show up in Google Images: the style |
| 23 | // examples on the home page and every finished commission in the gallery. |
| 24 | const styleImages = [...new Set(STYLE_CATALOG.map((s) => s.example))]; |
| 25 | const galleryImages = [...new Set(ALL_PAIRS.map((p) => p.after.src))]; |
| 26 | return [ |
| 27 | { url: `${SITE}/`, changeFrequency: 'weekly', priority: 1.0, lastModified: now, images: styleImages }, |
| 28 | { url: `${SITE}/gallery`, changeFrequency: 'weekly', priority: 0.9, lastModified: now, images: galleryImages }, |
| 29 | { url: `${SITE}/reviews`, changeFrequency: 'weekly', priority: 0.6, lastModified: now }, |
| 30 | { url: `${SITE}/studio`, changeFrequency: 'monthly', priority: 0.8, lastModified: now }, |
| 31 | { url: `${SITE}/research`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, |
| 32 | { url: `${SITE}/careers`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, |
| 33 | { url: `${SITE}/privacy`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, |
| 34 | { url: `${SITE}/terms`, changeFrequency: 'yearly', priority: 0.3, lastModified: now }, |
| 35 | ]; |
| 36 | } |