vector / frontend /src /app /robots.ts
d-ragon's picture
Upload 674 files
689359a verified
Raw History Blame Contribute Delete
758 Bytes
import type { MetadataRoute } from "next";
import { getSiteUrl } from "@/lib/site";
const privatePaths = [
"/api/",
"/admin/",
"/list",
"/settings/",
"/tasks/",
"/share/",
];
const aiCrawlers = [
"OAI-SearchBot",
"GPTBot",
"ChatGPT-User",
"ClaudeBot",
"Claude-SearchBot",
"Claude-User",
"PerplexityBot",
"Perplexity-User",
"Google-Extended",
];
export default function robots(): MetadataRoute.Robots {
const siteUrl = getSiteUrl();
return {
rules: [
{
userAgent: "*",
allow: "/",
disallow: privatePaths,
},
{
userAgent: aiCrawlers,
allow: "/",
disallow: privatePaths,
},
],
sitemap: `${siteUrl}/sitemap.xml`,
host: siteUrl,
};
}