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.

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