update seo

This commit is contained in:
Timothy
2021-01-10 17:35:37 +08:00
parent 8cb73bff1d
commit 6a0a6e9530
12 changed files with 81 additions and 87 deletions

View File

@@ -1,7 +1,7 @@
import { NextSeo } from 'next-seo'
import { getAllFilesFrontMatter } from '@/lib/mdx'
import siteMetadata from '@/data/siteMetadata'
import ListLayout from '@/layouts/ListLayout'
import { PageSeo } from '@/components/SEO'
export async function getStaticProps() {
const posts = await getAllFilesFrontMatter('blog')
@@ -12,17 +12,11 @@ export async function getStaticProps() {
export default function Blog({ posts }) {
return (
<>
<NextSeo
<PageSeo
title={`Blog - ${siteMetadata.author}`}
description={siteMetadata.description}
canonical={`${siteMetadata.siteUrl}/blog`}
openGraph={{
url: `${siteMetadata.siteUrl}/blog`,
title: `Blog - ${siteMetadata.author}`,
description: siteMetadata.description,
}}
url={`${siteMetadata.siteUrl}/blog`}
/>
<ListLayout posts={posts} title="All Posts" />
</>
)