Skip to content

Commit

Permalink
refactor to use shouldBlockIndexing
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangohjw committed Jan 13, 2025
1 parent e2426df commit 3704c7b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/components/src/engine/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ export const getRobotsTxt = (props: IsomerPageSchemaType) => {

return {
sitemap: props.site.url ? `${props.site.url}/sitemap.xml` : undefined,
rules:
props.site.environment === "staging"
? {
userAgent: "*",
disallow: "/",
}
: rules,
rules: shouldBlockIndexing(props.site.environment)
? {
userAgent: "*",
disallow: "/",
}
: rules,
}
}

Expand Down

0 comments on commit 3704c7b

Please sign in to comment.