From 6cc85fe0d749b768b1f28ed3b460f25292ce2850 Mon Sep 17 00:00:00 2001 From: Han <1655466387@qq.com> Date: Fri, 21 Feb 2025 11:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Head.astro | 5 +++-- src/styles/components/Aside.less | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Head.astro b/src/components/Head.astro index ebe96fc..f3b2f38 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -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"; --- diff --git a/src/styles/components/Aside.less b/src/styles/components/Aside.less index 0a6dc5b..94048c6 100644 --- a/src/styles/components/Aside.less +++ b/src/styles/components/Aside.less @@ -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; }