This commit is contained in:
Han 2025-02-21 11:26:48 +08:00
parent 473f5deb96
commit 6cc85fe0d7
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,8 @@
---
import SITE_CONFIG from "../config";
// 当前页面的 URL 元地址
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const canonicalData = new URL(Astro.url.pathname, Astro.site);
const canonicalURL = canonicalData.href.replace(/\/+$/, "");
// 页面内容的元数据
const { Title, Keywords, Description, PageCover } = Astro.props;
const { Site, Title: SiteName, Subtitle, Author, Cover, DNSOptimization } = SITE_CONFIG;
@ -10,7 +11,7 @@ const SiteCover = Site + Cover;
const WebCover = PageCover || SiteCover;
// Schema.org 结构化数据JSON-LD
const WebSiteData = { "@context": "https://schema.org", "@type": "WebSite", name: WebTitle, url: canonicalURL, image: { "@type": "ImageObject", url: SiteCover } };
const ArticleData = { "@context": "https://schema.org", "@type": "BlogPosting", mainEntityOfPage: { "@type": "WebPage", "@id": canonicalURL.href }, headline: WebTitle, image: [WebCover], author: { "@type": "Person", name: Author, url: Site }, publisher: { "@type": "Organization", name: SiteName, logo: { "@type": "ImageObject", url: SiteCover } } };
const ArticleData = { "@context": "https://schema.org", "@type": "BlogPosting", mainEntityOfPage: { "@type": "WebPage", "@id": canonicalURL }, headline: WebTitle, image: [WebCover], author: { "@type": "Person", name: Author, url: Site }, publisher: { "@type": "Organization", name: SiteName, logo: { "@type": "ImageObject", url: SiteCover } } };
// 基础 样式
import "../styles/Base.less";
---

View File

@ -147,7 +147,7 @@ aside.vh-aside {
bottom: 0;
width: 100%;
height: 0;
background: #EDEEF366;
background: #EDEEF3;
transition: height 0.16s ease-in-out;
z-index: -1;
}