-
-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Remove default "robots" meta (#1166)
- Loading branch information
Showing
9 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
describe('SEO Meta No Robots', () => { | ||
it('App loads', () => { | ||
cy.visit('http://localhost:3000'); | ||
cy.get('h1').should('contain', 'Default SEO'); | ||
}); | ||
|
||
it('SEO norobots', () => { | ||
cy.visit('http://localhost:3000/norobots'); | ||
cy.get('head meta[name="robots"]').should('not.exist'); | ||
}); | ||
|
||
it('SEO overrides norobots with nofollow correctly', () => { | ||
cy.visit('http://localhost:3000/norobots/nofollow'); | ||
cy.get('head meta[name="robots"]').should( | ||
'have.attr', | ||
'content', | ||
'index,nofollow', | ||
); | ||
}); | ||
|
||
it('SEO overrides norobots with nofollow correctly', () => { | ||
cy.visit('http://localhost:3000/norobots/noindex'); | ||
cy.get('head meta[name="robots"]').should( | ||
'have.attr', | ||
'content', | ||
'noindex,follow', | ||
); | ||
}); | ||
|
||
it('SEO overrides norobots with robots props correctly', () => { | ||
cy.visit('http://localhost:3000/norobots/robots'); | ||
cy.get('head meta[name="robots"]').should( | ||
'have.attr', | ||
'content', | ||
'index,follow,nosnippet,max-snippet:-1,max-image-preview:none,noarchive,noimageindex,max-video-preview:-1,notranslate', | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { NextSeo } from '../../..'; | ||
import Links from '../../components/links'; | ||
|
||
const NoRobots = () => ( | ||
<> | ||
<NextSeo title="NoRobots" /> | ||
<h1>norobots</h1> | ||
<Links /> | ||
</> | ||
); | ||
export default NoRobots; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { NextSeo } from '../../..'; | ||
import Links from '../../components/links'; | ||
|
||
const NoRobotsNoFollow = () => ( | ||
<> | ||
<NextSeo title="NoRobots NoFollow" nofollow /> | ||
<h1>norobots and nofollow</h1> | ||
<Links /> | ||
</> | ||
); | ||
export default NoRobotsNoFollow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { NextSeo } from '../../..'; | ||
import Links from '../../components/links'; | ||
|
||
const NoRobotsNoIndex = () => ( | ||
<> | ||
<NextSeo title="NoRobots NoIndex" noindex /> | ||
<h1>norobots and noindex</h1> | ||
<Links /> | ||
</> | ||
); | ||
export default NoRobotsNoIndex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { NextSeo } from '../../..'; | ||
import Links from '../../components/links'; | ||
|
||
const Robots = () => ( | ||
<> | ||
<NextSeo | ||
title="Robots meta title" | ||
robotsProps={{ | ||
nosnippet: true, | ||
notranslate: true, | ||
noimageindex: true, | ||
noarchive: true, | ||
maxSnippet: -1, | ||
maxImagePreview: 'none', | ||
maxVideoPreview: -1, | ||
}} | ||
/> | ||
<h1>Norobots with Robots meta properties</h1> | ||
<Links /> | ||
</> | ||
); | ||
|
||
export default Robots; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters