未验证 提交 3cd4d01d 编写于 作者: Z Zhe Zhang 提交者: GitHub

Fixes #10333 `with-next-seo` sample issues (#10335)

上级 9546011a
......@@ -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} />
</>
)
}
import React from 'react'
import NextSeo from 'next-seo'
import { NextSeo } from 'next-seo'
import Link from 'next/link'
export default () => (
......
import React from 'react'
import { ArticleJsonLd } from 'next-seo'
// See all available JSON-LD here:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册