Branchwell

Lumen & Gesso / website · lumengesso.com / app / robots.ts

1import type { MetadataRoute } from 'next';
2import { COMING_SOON } from './config';
3
4// Served as /robots.txt by Next's file convention.
5//
6// While the launch gate is up we tell crawlers to skip the whole site —
7// the only thing that would index is the "Opening soon" holding page, and
8// having that be Google's first impression of lumengesso.com (cached for
9// weeks) would be worse than no impression. Once COMING_SOON=false we
10// open it up and point at the sitemap.
11//
12// Admin + checkout + auth routes are always disallowed regardless of
13// launch state; they're either gated or transient and shouldn't appear
14// in search results.
15const AI_CRAWLERS = [
16 'GPTBot',
17 'OAI-SearchBot',
18 'ChatGPT-User',
19 'ClaudeBot',
20 'Claude-User',
21 'Claude-SearchBot',
22 'PerplexityBot',
23 'Perplexity-User',
24 'Google-Extended',
25 'Applebot-Extended',
26 'CCBot',
27];
28
29export default function robots(): MetadataRoute.Robots {
30 const SITE = (process.env.NEXT_PUBLIC_SITE_URL || 'https://lumengesso.com').replace(/\/$/, '');
31
32 if (COMING_SOON) {
33 return {
34 rules: [{ userAgent: '*', disallow: '/' }],
35 // Still expose the sitemap (just the home page in coming-soon mode)
36 // so we have something to feed Search Console once we flip the gate.
37 sitemap: `${SITE}/sitemap.xml`,
38 };
39 }
40
41 const disallow = [
42 '/admin',
43 '/admin/',
44 '/api/',
45 '/auth/',
46 '/checkout',
47 '/login',
48 '/orders',
49 '/orders/',
50 ];
51
52 return {
53 rules: [
54 { userAgent: '*', allow: '/', disallow },
55 // AI search and assistant crawlers, named so they know they're
56 // welcome: being cited in ChatGPT, Claude, Perplexity, Gemini and
57 // Apple answers is how people find the studio there. Same rules.
58 { userAgent: AI_CRAWLERS, allow: '/', disallow },
59 ],
60 sitemap: `${SITE}/sitemap.xml`,
61 host: SITE,
62 };
63}