Skip to content

Commit

Permalink
chore(robots.txt): disallow robots in non-production
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Jan 24, 2025
1 parent 4318936 commit 76d1c94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions next-sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ module.exports = {
generateIndexSitemap: false,
sitemapSize: 7000,
generateRobotsTxt: true,
robosTxtOptions: {
policies: [{ userAgent: '*', allow: '/' }],
robotsTxtOptions: {
policies:
environment === 'production'
? [{ userAgent: '*', allow: '/' }]
: [{ userAgent: '*', disallow: '/' }],
},

// Adds path as it doesn't support dynamic routes.
Expand Down

0 comments on commit 76d1c94

Please sign in to comment.