Skip to content
Merged
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
62 changes: 46 additions & 16 deletions apps/sim/app/robots.ts
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,59 @@
import type { MetadataRoute } from 'next'
import { getBaseUrl } from '@/lib/core/utils/urls'

const DISALLOWED_PATHS = [
'/api/',
'/workspace/',
'/chat/',
'/playground/',
'/resume/',
'/invite/',
'/unsubscribe/',
'/w/',
'/form/',
'/credential-account/',
'/_next/',
'/private/',
'/blog*tag=',
]

/** Looser disallow than the wildcard so OG previews can fetch /chat/ and /form/. */
const LINK_PREVIEW_DISALLOWED_PATHS = [
'/api/',
'/workspace/',
'/w/',
'/playground/',
'/resume/',
'/invite/',
'/unsubscribe/',
'/credential-account/',
'/_next/',
'/private/',
]
Comment thread
waleedlatif1 marked this conversation as resolved.
Comment thread
waleedlatif1 marked this conversation as resolved.

const LINK_PREVIEW_BOTS = [
'Twitterbot',
'LinkedInBot',
'Slackbot',
'Slack-ImgProxy',
'Discordbot',
'TelegramBot',
'WhatsApp',
'facebookexternalhit',
'Pinterestbot',
'redditbot',
]

export default function robots(): MetadataRoute.Robots {
const baseUrl = getBaseUrl()

return {
rules: [
{ userAgent: '*', allow: '/', disallow: DISALLOWED_PATHS },
{
userAgent: '*',
userAgent: LINK_PREVIEW_BOTS,
allow: '/',
disallow: [
'/api/',
'/workspace/',
'/chat/',
'/playground/',
'/resume/',
'/invite/',
'/unsubscribe/',
'/w/',
'/form/',
'/credential-account/',
'/_next/',
'/private/',
'/blog*tag=',
],
disallow: LINK_PREVIEW_DISALLOWED_PATHS,
},
],
sitemap: [`${baseUrl}/sitemap.xml`, `${baseUrl}/blog/sitemap-images.xml`],
Expand Down
Loading