Refactor some code to make it looks cleaner

This commit is contained in:
PrinOrange
2023-12-29 19:55:54 +08:00
parent 643d528816
commit aa94563763
22 changed files with 87 additions and 106 deletions

View File

@@ -1,4 +1,4 @@
import { RSSFeedLink } from "@/consts/consts";
import { RSSFeedURL, WebsiteURL } from "@/consts/consts";
import { Config } from "@/data/config";
import { NextSeo } from "next-seo";
@@ -6,13 +6,13 @@ export const SEO = (props: { title: string; description?: string | null; coverUR
return (
<>
<title>{props.title}</title>
<link rel="alternate" type="application/rss+xml" href={RSSFeedLink} />
<link rel="alternate" type="application/rss+xml" href={RSSFeedURL} />
<NextSeo
title={props.title}
description={props.description ?? undefined}
description={props.description ?? Config.Sentence}
openGraph={{
title: props.title,
description: props.description ?? undefined,
description: props.description ?? Config.Sentence,
images: props.coverURL
? [
{
@@ -22,11 +22,18 @@ export const SEO = (props: { title: string; description?: string | null; coverUR
alt: props.title,
},
]
: [],
: [
{
url: Config.PageCovers.websiteCoverURL,
width: 850,
height: 650,
alt: props.title,
},
],
}}
twitter={{
handle: `@${Config.SocialLinks.twitter}`,
site: Config.SiteDomain,
site: WebsiteURL,
cardType: "summary_large_image",
}}
/>