Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 6a59fe5

Browse files
committed
add <NextSeo /> component
1 parent f60745f commit 6a59fe5

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

pages/[...slug].js

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import Layout from '@/components/common/Layout'
2-
import {Info} from '@/components/molecules/Alert'
3-
import PropTypes from 'prop-types'
41
import getPostTypeStaticPaths from '@/api/wordpress/_global/getPostTypeStaticPaths'
52
import getPostTypeStaticProps from '@/api/wordpress/_global/getPostTypeStaticProps'
3+
import Layout from '@/components/common/Layout'
4+
import {NextSeo} from 'next-seo'
5+
import PropTypes from 'prop-types'
66

77
// Define route post type.
88
const postType = 'page'
@@ -16,15 +16,22 @@ const postType = 'page'
1616
*/
1717
export default function Page({post}) {
1818
return (
19-
<Layout title={post?.title} description={post?.excerpt}>
19+
<Layout>
20+
<NextSeo
21+
title="Query from Yoast SEO"
22+
description="Query from Yoast SEO"
23+
openGraph={{
24+
title: 'Query from Yoast SEO',
25+
description: 'Query from Yoast SEO',
26+
images: [
27+
{
28+
url: 'Query from Yoast SEO',
29+
alt: 'Query from Yoast SEO'
30+
}
31+
]
32+
}}
33+
/>
2034
<div className="container">
21-
<Info>
22-
The content below is sourced from the WordPress REST-API.{' '}
23-
<a href="https://nextjs.org/docs/basic-features/data-fetching#getstaticpaths-static-generation">
24-
Learn more about SSG.
25-
</a>
26-
</Info>
27-
2835
<section>
2936
<article>
3037
<h1 dangerouslySetInnerHTML={{__html: post?.title}} />

0 commit comments

Comments
 (0)