From ab0b845d063b11728ebdcdd210e770cc8a4e2693 Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Wed, 4 Sep 2024 13:32:09 +0200 Subject: [PATCH] feat(sitemap): generate robots.txt with sitemap reference --- src/app/robots.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/app/robots.ts diff --git a/src/app/robots.ts b/src/app/robots.ts new file mode 100644 index 000000000..0c36b9bc3 --- /dev/null +++ b/src/app/robots.ts @@ -0,0 +1,10 @@ +import type { MetadataRoute } from "next"; + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: "*", + }, + sitemap: new URL("sitemap.xml", process.env.NEXT_PUBLIC_URL).toString(), + }; +}