mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-24 11:11:29 +08:00
124 lines
3.7 KiB
Plaintext
124 lines
3.7 KiB
Plaintext
---
|
|
import { WEBMENTION_PINGBACK, WEBMENTION_URL } from "astro:env/client";
|
|
import { siteConfig } from "@/site.config";
|
|
import type { SiteMeta } from "@/types";
|
|
import "@/styles/global.css";
|
|
|
|
type Props = SiteMeta;
|
|
|
|
const { articleDate, description, ogImage, title, tags } = Astro.props;
|
|
|
|
const titleSeparator = "•";
|
|
const siteTitle = `${title} ${titleSeparator} ${siteConfig.title}`;
|
|
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
|
const socialImageURL = new URL(ogImage ? ogImage : "/social-card.png", Astro.url).href;
|
|
---
|
|
|
|
<meta charset="utf-8" />
|
|
<meta
|
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
|
name="viewport"
|
|
/>
|
|
<title>{siteTitle}</title>
|
|
|
|
{/* Icons */}
|
|
<link href="/icon.svg" rel="icon" type="image/svg+xml" />
|
|
{
|
|
import.meta.env.PROD && (
|
|
<>
|
|
{/* Favicon & Apple Icon */}
|
|
<link rel="icon" href="/favicon-32x32.png" type="image/png" />
|
|
<link href="/icons/apple-touch-icon.png" rel="apple-touch-icon" />
|
|
{/* Manifest */}
|
|
<link href="/manifest.webmanifest" rel="manifest" />
|
|
</>
|
|
)
|
|
}
|
|
|
|
{/* Canonical URL */}
|
|
<link href={canonicalURL} rel="canonical" />
|
|
|
|
{/* Primary Meta Tags */}
|
|
<meta content={siteTitle} name="title" />
|
|
<meta content={description} name="description" />
|
|
<meta content={siteConfig.author} name="author" />
|
|
{tags && <meta content={tags} name="tags" />}
|
|
|
|
{/* Open Graph / Facebook */}
|
|
<meta content={articleDate ? "article" : "website"} property="og:type" />
|
|
<meta content={title} property="og:title" />
|
|
<meta content={description} property="og:description" />
|
|
<meta content={canonicalURL} property="og:url" />
|
|
<meta content={siteConfig.title} property="og:site_name" />
|
|
<meta content={siteConfig.ogLocale} property="og:locale" />
|
|
<meta content={socialImageURL} property="og:image" />
|
|
<meta content="1200" property="og:image:width" />
|
|
<meta content="630" property="og:image:height" />
|
|
{
|
|
articleDate && (
|
|
<>
|
|
<meta content={siteConfig.author} property="article:author" />
|
|
<meta content={articleDate} property="article:published_time" />
|
|
</>
|
|
)
|
|
}
|
|
|
|
{/* Twitter */}
|
|
<meta content="summary_large_image" property="twitter:card" />
|
|
<meta content={canonicalURL} property="twitter:url" />
|
|
<meta content={title} property="twitter:title" />
|
|
<meta content={description} property="twitter:description" />
|
|
<meta content={socialImageURL} property="twitter:image" />
|
|
|
|
{/* Sitemap */}
|
|
<link href="/sitemap-index.xml" rel="sitemap" />
|
|
|
|
{/* RSS auto-discovery */}
|
|
<link href="/rss.xml" title="Blog" rel="alternate" type="application/rss+xml" />
|
|
<link href="/notes/rss.xml" title="Notes" rel="alternate" type="application/rss+xml" />
|
|
|
|
{/* Webmentions */}
|
|
{
|
|
WEBMENTION_URL && (
|
|
<>
|
|
<link href={WEBMENTION_URL} rel="webmention" />
|
|
{WEBMENTION_PINGBACK && <link href={WEBMENTION_PINGBACK} rel="pingback" />}
|
|
</>
|
|
)
|
|
}
|
|
|
|
<meta name="baidu-site-verification" content="codeva-ZWUil8ENc0" />
|
|
<meta name="google-adsense-account" content="ca-pub-6184816340945344" />
|
|
<script
|
|
async
|
|
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6184816340945344"
|
|
crossorigin="anonymous"></script>
|
|
|
|
<script type="text/javascript">
|
|
(function (c, l, a, r, i, t, y) {
|
|
c[a] =
|
|
c[a] ||
|
|
function () {
|
|
(c[a].q = c[a].q || []).push(arguments);
|
|
};
|
|
t = l.createElement(r);
|
|
t.async = 1;
|
|
t.src = "https://www.clarity.ms/tag/" + i;
|
|
y = l.getElementsByTagName(r)[0];
|
|
y.parentNode.insertBefore(t, y);
|
|
})(window, document, "clarity", "script", "kvbyuhu6d2");
|
|
</script>
|
|
<!-- Google tag (gtag.js) -->
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-F4KLD4XCDB"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag() {
|
|
dataLayer.push(arguments);
|
|
}
|
|
gtag("js", new Date());
|
|
|
|
gtag("config", "G-F4KLD4XCDB");
|
|
</script>
|
|
|
|
<meta content={Astro.generator} name="generator" />
|