Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

23 linesCodeBlameRaw
1/**
2 * What /robots.txt says: everything may be crawled but a file's blame
3 * (`?blame=1`, and the `/<owner>/<repo>/blame/…` data it fetches), and
4 * where the site's maps are.
5 *
6 * Blame is the costliest file view to work out, one per file per commit a
7 * crawler finds, and adds nothing an index needs that the file itself does
8 * not have: on 2026-10-14 crawlers asked for 1,150 blame pages in four
9 * hours, against a handful from people. The links to it are `nofollow` too,
10 * and its page is `noindex` (routes/repo/blob.tsx).
11 */
12
13/** g1t.sh's docs keep their own map; a self-hosted g1t has no docs site. */
14const DOCS_SITEMAP = "https://docs.g1t.sh/sitemap-index.xml";
15
16/** Paths crawlers are kept from, wherever the query puts `blame`. */
17export const DISALLOWED = ["/*?blame=", "/*&blame=", "/*/*/blame/"];
18
19export function robotsTxt(site: string): string {
20 const lines = ["User-agent: *", "Allow: /", ...DISALLOWED.map((path) => `Disallow: ${path}`), "", `Sitemap: ${site}/sitemap.xml`];
21 if (site === "https://g1t.sh") lines.push(`Sitemap: ${DOCS_SITEMAP}`);
22 return `${lines.join("\n")}\n`;
23}