Skip to content

Commit

Permalink
Add experimental flag to allow stores to disable NextSEO robots (#2140)
Browse files Browse the repository at this point in the history
## What's the purpose of this pull request?

FastStore stores use NextSEO's default robot tags. This PR allows stores
to opt-out of the robot tags and write their own.

Solves #2139 

## How to test it?

Check the deploy preview [of this
PR](vtex-sites/starter.store#294) and see that
there are no robot tags.

## References

[Next SEO](https://github.com/garmeeh/next-seo)
  • Loading branch information
gvc authored Dec 4, 2023
1 parent 4ca5f72 commit e59b10c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/core/faststore.config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ module.exports = {
experimental: {
cypressVersion: 12,
enableCypressExtension: false,
noRobots: false,
},
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"include-media": "^1.4.10",
"msw": "^0.43.1",
"next": "^12.3.1",
"next-seo": "^5.4.0",
"next-seo": "^6.4.0",
"nextjs-progressbar": "^0.0.14",
"postcss": "^8.4.4",
"prettier": "^2.2.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import Layout from 'src/Layout'
import AnalyticsHandler from 'src/sdk/analytics'
import ErrorBoundary from 'src/sdk/error/ErrorBoundary'

import storeConfig from '../../faststore.config'

import { DefaultSeo } from 'next-seo'

function App({ Component, pageProps }: AppProps) {
return (
<ErrorBoundary>
Expand All @@ -20,6 +24,8 @@ function App({ Component, pageProps }: AppProps) {
options={{ showSpinner: false }}
/>

<DefaultSeo norobots={storeConfig.experimental.noRobots} />

<AnalyticsHandler />

<UIProvider>
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14945,16 +14945,16 @@ next-mdx-remote@^4.2.1:
vfile "^5.3.0"
vfile-matter "^3.0.1"

next-seo@^5.4.0:
version "5.15.0"
resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-5.15.0.tgz#b1a90508599774982909ea44803323c6fb7b50f4"
integrity sha512-LGbcY91yDKGMb7YI+28n3g+RuChUkt6pXNpa8FkfKkEmNiJkeRDEXTnnjVtwT9FmMhG6NH8qwHTelGrlYm9rgg==

next-seo@^6.0.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-6.1.0.tgz#b60b06958cc77e7ed56f0a61b2d6cd0afed88ebb"
integrity sha512-iMBpFoJsR5zWhguHJvsoBDxDSmdYTHtnVPB1ij+CD0NReQCP78ZxxbdL9qkKIf4oEuZEqZkrjAQLB0bkII7RYA==

next-seo@^6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-6.4.0.tgz#05a75b8acae881f856eb690b1f66b5e8741aa16e"
integrity sha512-XQFxkOL2hw0YE+P100HbI3EAvcludlHPxuzMgaIjKb7kPK0CvjGvLFjd9hszZFEDc5oiQkGFA8+cuWcnip7eYA==

next-themes@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.2.1.tgz#0c9f128e847979daf6c67f70b38e6b6567856e45"
Expand Down

0 comments on commit e59b10c

Please sign in to comment.