添加 SEO 结构化数据

This commit is contained in:
Han
2025-02-20 19:04:58 +08:00
parent 126751ca79
commit 925b144426
4 changed files with 26 additions and 15 deletions
+4 -1
View File
@@ -10,6 +10,9 @@ export async function getStaticPaths() {
// 处理文章内容
type Props = CollectionEntry<"blog">;
const post: any = Astro.props;
// 获取封面图
import getCover from "../../utils/getCover";
const ARTICLE_COVER: string = await getCover(post.data.cover);
// 页面 Info
import SITE_CONFIG from "../../config";
const { Site, Title, Author, Twikoo } = SITE_CONFIG;
@@ -28,7 +31,7 @@ import Comment from "../../components/Comment.astro";
import "../../styles/Article.less";
---
<Layout title={post.data.title} keywords={post.data.tags} description={description}>
<Layout title={post.data.title} keywords={post.data.tags} description={description} pagecover={ARTICLE_COVER}>
<section class="vh-container">
<article class="vh-animation vh-article-main">
<header>