Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: Dynamic robots.txt for SEO pages

Richie McIlroy39d3964f0d3c
diff --git a/apps/web/app/robots.ts b/apps/web/app/robots.ts
new file mode 100644
index 000000000..d0484f33b
--- /dev/null
+++ b/apps/web/app/robots.ts
@@ -0,0 +1,28 @@
+import { seoPages } from "@/lib/seo-pages";
+import { MetadataRoute } from "next";
+
+export default function robots(): MetadataRoute.Robots {
+ // Get all SEO page slugs
+ const seoPageSlugs = Object.keys(seoPages);
+
+ return {
+ rules: {
+ userAgent: '*',
+ allow: [
+ '/',
+ '/updates/',
+ // Dynamically add all SEO pages
+ ...seoPageSlugs.map(slug => `/${slug}`),
+ ],
+ disallow: [
+ '/dashboard',
+ '/s/',
+ '/login',
+ '/invite',
+ '/onboarding',
+ '/record',
+ ],
+ },
+ sitemap: 'https://cap.so/sitemap.xml',
+ };
+}
\ No newline at end of file