Skip to content

Commit ccb0213

Browse files
committed
fix: update robots meta tag in non prod builds
1 parent 0cb0ae6 commit ccb0213

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build.washingtonpost.com/components/next-seo/defaultSeo.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ interface DefaultSeoProps {
3333
}
3434

3535
export const DefaultSeo: React.FC<DefaultSeoProps> = ({ seoConfig }) => {
36+
const env = process.env.VERCEL_ENV || "";
37+
3638
return (
3739
<Head>
3840
<title>{seoConfig.defaultTitle}</title>
@@ -54,7 +56,12 @@ export const DefaultSeo: React.FC<DefaultSeoProps> = ({ seoConfig }) => {
5456
content={seoConfig.twitter.description}
5557
/>
5658
<meta name="twitter:creator" content={seoConfig.twitter.handle} />
57-
<meta name="robots" content="index,follow" />
59+
<meta
60+
name="robots"
61+
content={`${
62+
env === "production" ? "index,follow" : "noindex, nofollow"
63+
}`}
64+
/>
5865
</Head>
5966
);
6067
};

0 commit comments

Comments
 (0)