docs(pages): 自定义 Astro 的 Frontmatter

1. docs: 自定义 Astro 的 Frontmatter
2. docs: 你是人类吗?
3. fix(config): Umami 更改网站名称导致的密钥失效
4. feat(config): 新增关闭头图
5. feat(config): 新增更改文章内部头图
6. docs(chore): 更改了 doc: 进行 Folo 订阅源认证 的标题
This commit is contained in:
Ad-closeNN
2025-08-13 13:53:19 +08:00
parent ef721f28cd
commit c5af07d1c8
11 changed files with 381 additions and 5 deletions
+20 -2
View File
@@ -44,6 +44,13 @@ const jsonLd = {
: siteConfig.lang.replace("_", "-"),
// TODO include cover image here
};
// 获取头图 boolean,无需设置 true
const showcover = entry.data.showcover;
// 获取自定义的头图(Markdown 内部)
const customcover = entry.data.customcover;
---
<MainGridLayout banner={entry.data.image} title={entry.data.title} description={entry.data.description} lang={entry.data.lang} setOGTypeArticle={true} headings={headings}>
<script is:inline slot="head" type="application/ld+json" set:html={JSON.stringify(jsonLd)}></script>
@@ -96,11 +103,22 @@ const jsonLd = {
</div>
<!-- always show cover as long as it has one -->
{entry.data.image &&
<!-- 使用自制 showcover 控制器控制头图的出现 -->
{showcover && entry.data.image &&
<ImageWrapper id="post-cover" src={entry.data.image} basePath={path.join("content/posts/", getDir(entry.id))} class="mb-8 rounded-xl banner-container onload-animation"/>
}
<!-- 自制内部头图 customcover-->
{customcover &&
<ImageWrapper id="post-cover" src={entry.data.customcover} basePath={path.join("content/posts/", getDir(entry.id))} class="mb-8 rounded-xl banner-container onload-animation"/>
}
<!-- 头图调试代码
<pre>
showcover(变量): {showcover} (type: {typeof showcover})
entry.data.showcover: {entry.data.showcover} (type: {typeof entry.data.showcover})
</pre>
-->
<Markdown class="mb-6 markdown-content onload-animation">
<Content />