封装评论组件 内置【Twikoo、Waline】✅

This commit is contained in:
Han
2025-03-25 17:27:12 +08:00
parent bf2bdf1720
commit 3bf613946c
16 changed files with 215 additions and 43 deletions
+3 -2
View File
@@ -14,7 +14,7 @@ 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, GoogleAds } = SITE_CONFIG;
const { Site, Title, Author, GoogleAds } = SITE_CONFIG;
// 处理文章内容
const description = getDescription(post);
const { Content, remarkPluginFrontmatter } = await render(post);
@@ -29,6 +29,7 @@ import Copyright from "@/components/Copyright/Copyright.astro";
// Reward 组件
import Reward from "@/components/Reward/Reward.astro";
// 评论组件
import { checkComment } from "@/scripts/Comment";
import Comment from "@/components/Comment/Comment.astro";
// Google 广告组件
import GoogleAd from "@/components/GoogleAd/GoogleAd.astro";
@@ -70,7 +71,7 @@ import "@/styles/ArticleBase.less";
<!-- 底部谷歌广告 -->
{GoogleAds.ad_Client && GoogleAds.articleAD_Slot && <GoogleAd className="vh-article-ad" slotID={GoogleAds.articleAD_Slot} />}
</footer>
{Twikoo.envId && <Comment envId={Twikoo.envId} />}
{checkComment() && <Comment />}
</article>
<Aside />
</section>