Skip to content

Commit

Permalink
templates(website): add next sitemap robots disallow config for /admin (
Browse files Browse the repository at this point in the history
#9761)

Sets robots disallow to /admin
  • Loading branch information
paulpopus authored Dec 5, 2024
1 parent 8f785e1 commit 97d3bb1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion templates/website/next-sitemap.config.cjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
/** @type {import('next-sitemap').IConfig} */
const SITE_URL =
process.env.NEXT_PUBLIC_SERVER_URL ||
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
'https://example.com'

/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: SITE_URL,
generateRobotsTxt: true,
exclude: ['/posts-sitemap.xml', '/pages-sitemap.xml', '/*', '/posts/*'],
robotsTxtOptions: {
policies: [
{
userAgent: '*',
disallow: '/admin/*',
},
],
additionalSitemaps: [`${SITE_URL}/pages-sitemap.xml`, `${SITE_URL}/posts-sitemap.xml`],
},
}

0 comments on commit 97d3bb1

Please sign in to comment.