feat: remove inaccurate authors

This commit is contained in:
DIYgod 2022-11-24 18:15:27 +00:00
parent de20c2b3b3
commit c78693d518
No known key found for this signature in database
GPG Key ID: D159328F47A80DCA
3 changed files with 17 additions and 21 deletions

View File

@ -50,9 +50,9 @@ export const getServerSideProps = async (
reject(notFound())
}
if (page?.authors[0]) {
await prefetchGetUserSites(page?.authors[0], queryClient)
}
// if (page?.authors[0]) {
// await prefetchGetUserSites(page?.authors[0], queryClient)
// }
} catch (error) {
reject(error)
}

View File

@ -10,7 +10,7 @@ export const SitePage: React.FC<{
page?: Note | null
site?: Profile | null
}> = ({ page, site }) => {
const author = useGetUserSites(page?.authors?.[0])
// const author = useGetUserSites(page?.authors?.[0])
function addPageJsonLd() {
return {
@ -23,17 +23,15 @@ export const SitePage: React.FC<{
}),
datePublished: page?.date_published,
dateModified: page?.date_updated,
...(author && {
author: [
{
"@type": "Person",
name: author?.data?.[0]?.name,
url: getSiteLink({
subdomain: author?.data?.[0]?.username || "",
}),
},
],
}),
author: [
{
"@type": "Person",
name: site?.name,
url: getSiteLink({
subdomain: site?.username || "",
}),
},
],
}),
}
}
@ -61,9 +59,7 @@ export const SitePage: React.FC<{
{page?.title}
</h2>
)}
{page?.tags?.includes("post") && (
<PostMeta page={page} site={site} author={author.data?.[0]} />
)}
{page?.tags?.includes("post") && <PostMeta page={page} site={site} />}
</div>
<PageContent
className="mt-10"

View File

@ -45,9 +45,9 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
image: `${link}${page.cover}`,
date_published: page.date_published,
date_modified: page.date_updated,
authors: page.authors?.map((author: any) => ({
name: author,
})),
// authors: page.authors?.map((author: any) => ({
// name: author,
// })),
tags: page.tags,
})),
}),