From d2c5a82747952979f29ac11844111f8fcb933966 Mon Sep 17 00:00:00 2001 From: Tenemo Date: Sat, 4 Apr 2026 20:16:02 +0200 Subject: [PATCH] sitemap in robots.txt --- e2e/robots.spec.ts | 18 ++++++++++++++++++ public/robots.txt | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 e2e/robots.spec.ts diff --git a/e2e/robots.spec.ts b/e2e/robots.spec.ts new file mode 100644 index 0000000..609c5a7 --- /dev/null +++ b/e2e/robots.spec.ts @@ -0,0 +1,18 @@ +import { expect, test } from '@playwright/test'; + +import { E2E_BASE_URL } from './support/e2eConfig'; +import { PRODUCTION_SITE_ORIGIN } from './support/siteContracts'; + +test('robots.txt allows crawling and advertises the sitemap', async ({ + request, +}) => { + const response = await request.get(`${E2E_BASE_URL}/robots.txt`); + + expect(response.ok()).toBe(true); + + const robots = await response.text(); + + expect(robots).toContain('User-agent: *'); + expect(robots).toContain('Allow: /'); + expect(robots).toContain(`Sitemap: ${PRODUCTION_SITE_ORIGIN}/sitemap.xml`); +}); diff --git a/public/robots.txt b/public/robots.txt index c2a49f4..46be956 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,2 +1,4 @@ User-agent: * Allow: / + +Sitemap: https://piech.dev/sitemap.xml