Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ changes.
- `tests/site.test.ts` checks the tagged showrecorder.app links and where "Get the beta" goes.
- `tests/metadata.test.ts` checks the title and description lengths, the canonical address, and that the share
image is a 1200 x 630 PNG on the Open Graph card and a large Twitter card.
- `tests/robots.test.ts` checks that robots.txt allows every crawler, names the AI crawlers (`AI_CRAWLERS` in
`lib/site.ts`) and blocks nothing.
- `tests/analytics.test.ts` checks the PostHog setup, the `?internal=1` opt-out and the Content-Security-Policy.

## Where things live
Expand Down
8 changes: 6 additions & 2 deletions website/app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import type { MetadataRoute } from "next";
import { SITE_URL } from "@/lib/site";
import { AI_CRAWLERS, SITE_URL } from "@/lib/site";

export const dynamic = "force-static";

export default function robots(): MetadataRoute.Robots {
return { rules: { userAgent: "*", allow: "/" }, sitemap: `${SITE_URL}/sitemap.xml` };
return {
// Every crawler first (search engines), then the AI crawlers by name (lib/site.ts).
rules: [{ userAgent: "*", allow: "/" }, ...AI_CRAWLERS.map((userAgent) => ({ userAgent, allow: "/" }))],
sitemap: `${SITE_URL}/sitemap.xml`,
};
}
18 changes: 18 additions & 0 deletions website/lib/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,21 @@ const SHOWRECORDER_URL = "https://showrecorder.app";
export function showRecorderLink(path = "/", campaign: "landing" | "llms" = "landing"): string {
return `${SHOWRECORDER_URL}${path}?utm_source=soundcheckplayer&utm_campaign=${campaign}`;
}

// The crawlers that feed AI search and assistants, named in robots.txt so the policy is explicit: all of them may
// read the site. The same list as showrecorder.app; training crawlers (Google-Extended, Applebot-Extended, CCBot)
// are included on purpose.
export const AI_CRAWLERS = [
"GPTBot",
"OAI-SearchBot",
"ChatGPT-User",
"ClaudeBot",
"Claude-SearchBot",
"Claude-User",
"PerplexityBot",
"Perplexity-User",
"Google-Extended",
"Applebot",
"Applebot-Extended",
"CCBot",
];
25 changes: 25 additions & 0 deletions website/tests/robots.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import robots from "@/app/robots";
import { AI_CRAWLERS } from "@/lib/site";

// robots.txt names the crawlers behind AI search and assistants, so the policy is stated: all of them may read the
// site. The first rule (every crawler) and the sitemap line are for search engines and stay as they were.

const rules = [robots().rules].flat();

describe("robots.txt", () => {
it("still allows every crawler first and names the sitemap", () => {
expect(rules[0]).toEqual({ userAgent: "*", allow: "/" });
expect(robots().sitemap).toBe("https://soundcheckplayer.app/sitemap.xml");
});

it("names the AI crawlers, each allowed everywhere", () => {
for (const bot of ["GPTBot", "OAI-SearchBot", "ChatGPT-User", "ClaudeBot", "PerplexityBot", "Google-Extended"]) {
expect(AI_CRAWLERS).toContain(bot);
}
expect(rules.slice(1)).toEqual(AI_CRAWLERS.map((userAgent) => ({ userAgent, allow: "/" })));
});

it("blocks nothing", () => {
for (const r of rules) expect(r.disallow).toBeUndefined();
});
});
Loading