Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
3cd4d01d
Unverified
Commit
3cd4d01d
authored
Jan 30, 2020
by
Zhe Zhang
Committed by
GitHub
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #10333 `with-next-seo` sample issues (#10335)
parent
9546011a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
26 deletions
+10
-26
_app.js
examples/with-next-seo/pages/_app.js
+9
-23
index.js
examples/with-next-seo/pages/index.js
+1
-2
jsonld.js
examples/with-next-seo/pages/jsonld.js
+0
-1
No files found.
examples/with-next-seo/pages/_app.js
View file @
3cd4d01d
...
...
@@ -3,30 +3,16 @@
* that will apply to every page. Full info on how the default works
* can be found here: https://github.com/garmeeh/next-seo#default-seo-configuration
*/
import
App
from
'next/app'
import
React
from
'react'
import
NextSeo
from
'next-seo'
import
{
DefaultSeo
}
from
'next-seo'
import
SEO
from
'../next-seo.config'
export
default
class
MyApp
extends
App
{
static
async
getInitialProps
({
Component
,
ctx
})
{
let
pageProps
=
{}
if
(
Component
.
getInitialProps
)
{
pageProps
=
await
Component
.
getInitialProps
(
ctx
)
}
return
{
pageProps
}
}
render
()
{
const
{
Component
,
pageProps
}
=
this
.
props
return
(
/* Here we call NextSeo and pass our default configuration to it */
<>
<
NextSeo
config
=
{
SEO
}
/
>
<
Component
{...
pageProps
}
/
>
<
/
>
)
}
export
default
function
MyApp
({
Component
,
pageProps
})
{
return
(
/* Here we call NextSeo and pass our default configuration to it */
<>
<
DefaultSeo
{...
SEO
}
/
>
<
Component
{...
pageProps
}
/
>
<
/
>
)
}
examples/with-next-seo/pages/index.js
View file @
3cd4d01d
import
React
from
'react'
import
NextSeo
from
'next-seo'
import
{
NextSeo
}
from
'next-seo'
import
Link
from
'next/link'
export
default
()
=>
(
...
...
examples/with-next-seo/pages/jsonld.js
View file @
3cd4d01d
import
React
from
'react'
import
{
ArticleJsonLd
}
from
'next-seo'
// See all available JSON-LD here:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment