Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today | 1 | /** |
| 2 | * /robots.txt: everything may be crawled, and where the site's maps are. | |
| 3 | * Served from the request's own origin, so a self-hosted g1t names itself. | |
| 4 | */ | |
| 5 | import type { Route } from "./+types/robots-txt"; | |
| 6 | ||
| 7 | /** g1t.sh's docs keep their own map; a self-hosted g1t has no docs site. */ | |
| 8 | const DOCS_SITEMAP = "https://docs.g1t.sh/sitemap-index.xml"; | |
| 9 | ||
| 10 | export function loader({ request }: Route.LoaderArgs) { | |
| 11 | const site = new URL(request.url).origin; | |
| 12 | const lines = ["User-agent: *", "Allow: /", "", `Sitemap: ${site}/sitemap.xml`]; | |
| 13 | if (site === "https://g1t.sh") lines.push(`Sitemap: ${DOCS_SITEMAP}`); | |
| 14 | return new Response(`${lines.join("\n")}\n`, { | |
| 15 | headers: { | |
| 16 | "content-type": "text/plain; charset=utf-8", | |
| 17 | "cache-control": "public, max-age=86400", | |
| 18 | }, | |
| 19 | }); | |
| 20 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.