优化细节

This commit is contained in:
Han 2025-06-06 11:02:14 +08:00
parent 2aa978451d
commit a515ecae39
5 changed files with 30 additions and 10 deletions

View File

@ -205,6 +205,10 @@ aside.vh-aside {
p { p {
padding: 0.28rem 0; padding: 0.28rem 0;
} }
img {
max-width: 100%;
}
} }
} }

View File

@ -10,8 +10,9 @@ const WebTitle = Title || SiteName;
const SiteCover = Site + Cover; const SiteCover = Site + Cover;
const WebCover = PageCover || SiteCover; const WebCover = PageCover || SiteCover;
// Schema.org 结构化数据JSON-LD // Schema.org 结构化数据JSON-LD
const WebSiteData = { "@context": "https://schema.org", "@type": "WebSite", name: WebTitle, url: canonicalURL, image: { "@type": "ImageObject", url: SiteCover } }; const WebSiteData = { "@context": "https://schema.org", "@type": "WebSite", url: canonicalURL, name: WebTitle, description: Description, inLanguage: "zh-CN", image: WebCover, publisher: { "@type": "Organization", name: WebTitle, logo: { "@type": "ImageObject", url: SiteCover } } };
const ArticleData = { "@context": "https://schema.org", "@type": "BlogPosting", 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, description: Description, image: [WebCover], datePublished: new Date().toISOString().replace("Z", `+08:00`), dateModified: new Date().toISOString().replace("Z", `+08:00`), author: { "@type": "Person", name: Author, url: Site }, publisher: { "@type": "Organization", name: SiteName, logo: { "@type": "ImageObject", url: SiteCover } }, keywords: (Keywords || ["Astro", "分享", "博客"]).join(", ") };
// 基础 样式 // 基础 样式
import "@/styles/Base.less"; import "@/styles/Base.less";
--- ---

View File

@ -3,7 +3,23 @@ import SITE_INFO from "@/config";
import "./Reward.less"; import "./Reward.less";
--- ---
{
SITE_INFO.Reward.AliPay && SITE_INFO.Reward.WeChat && (
<section class="vh-reward"> <section class="vh-reward">
<p>喜欢这篇文章嘛,觉得文章不错的话,奖励奖励我!</p> <p>喜欢这篇文章嘛,觉得文章不错的话,奖励奖励我!</p>
<div class="reward-list"><span class="alipay"><img src={SITE_INFO.Reward.AliPay} alt="支付宝打赏" />支付宝</span><span class="wechat"><img src={SITE_INFO.Reward.WeChat} alt="微信打赏" /> 微信</span></div> <div class="reward-list">
{SITE_INFO.Reward.AliPay && (
<span class="alipay">
<img src={SITE_INFO.Reward.AliPay} alt="支付宝打赏" />
支付宝
</span>
)}
{SITE_INFO.Reward.WeChat && (
<span class="wechat">
<img src={SITE_INFO.Reward.WeChat} alt="微信打赏" /> 微信
</span>
)}
</div>
</section> </section>
)
}

View File

@ -1,9 +1,7 @@
import type { APIRoute } from 'astro'; import type { APIRoute } from 'astro';
const getRobotsTxt = (sitemapURL: URL) => `User-agent: * const getRobotsTxt = (sitemapURL: URL) => `User-agent: *
Disallow: /MineWeb/ Allow: /
Disallow: /assets/
Disallow: /*?*
Sitemap: ${sitemapURL.href}`; Sitemap: ${sitemapURL.href}`;

View File

@ -2,7 +2,8 @@ import SITE_INFO from '@/config';
export default () => { export default () => {
const writeDom = document.querySelector('.header-main>.desc'); const writeDom = document.querySelector('.header-main>.desc');
if (!writeDom) return; if (!writeDom) return;
const TypeWriteList = SITE_INFO.TypeWriteList; const TypeWriteList: any = SITE_INFO.TypeWriteList;
if (!Array.isArray(TypeWriteList) || !TypeWriteList.length) return writeDom.remove();
let TypeWriteListIndex = 0; let TypeWriteListIndex = 0;
let index = 0; let index = 0;
let isDeleting = false; let isDeleting = false;