mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-04-02 01:54:50 +00:00
37 lines
1,012 B
Text
37 lines
1,012 B
Text
|
|
---
|
||
|
|
interface Props {
|
||
|
|
title: string;
|
||
|
|
description: string;
|
||
|
|
image?: string;
|
||
|
|
canonical?: string;
|
||
|
|
type?: "website" | "article";
|
||
|
|
}
|
||
|
|
|
||
|
|
const {
|
||
|
|
title,
|
||
|
|
description,
|
||
|
|
image = "/images/Bridget.png",
|
||
|
|
canonical,
|
||
|
|
type = "website",
|
||
|
|
} = Astro.props;
|
||
|
|
|
||
|
|
const url = new URL(Astro.url.pathname, Astro.site);
|
||
|
|
const canonicalUrl = canonical ?? url.toString();
|
||
|
|
const imageUrl = new URL(image, Astro.site).toString();
|
||
|
|
---
|
||
|
|
|
||
|
|
<title>{title}</title>
|
||
|
|
<meta name="description" content={description} />
|
||
|
|
<link rel="canonical" href={canonicalUrl} />
|
||
|
|
|
||
|
|
<meta property="og:title" content={title} />
|
||
|
|
<meta property="og:description" content={description} />
|
||
|
|
<meta property="og:type" content={type} />
|
||
|
|
<meta property="og:url" content={canonicalUrl} />
|
||
|
|
<meta property="og:image" content={imageUrl} />
|
||
|
|
|
||
|
|
<meta name="twitter:card" content="summary_large_image" />
|
||
|
|
<meta name="twitter:title" content={title} />
|
||
|
|
<meta name="twitter:description" content={description} />
|
||
|
|
<meta name="twitter:image" content={imageUrl} />
|