修改配置文件

This commit is contained in:
2026-06-18 21:59:07 +08:00 Unverified
parent fc76f9949f
commit ed2ef30d22
23 changed files with 270 additions and 137 deletions
+4 -3
View File
@@ -1,5 +1,6 @@
---
import { getCategoryHref, type BlogPost } from '@/lib/posts';
import { siteConfig } from '../../site.config.mjs';
type TocItem = {
depth: number;
@@ -19,7 +20,7 @@ interface Props {
}
const { post, toc, relatedPosts } = Astro.props;
const avatar = 'https://free.picui.cn/free/2025/08/10/689845496a283.png';
const avatar = siteConfig.author.avatar;
const topDepth = toc.length > 0 ? Math.min(...toc.map((item) => item.depth)) : 1;
const tocSections = toc.reduce<TocSection[]>((sections, item) => {
if (item.depth <= topDepth || sections.length === 0) {
@@ -34,8 +35,8 @@ const tocSections = toc.reduce<TocSection[]>((sections, item) => {
<aside class="article-sidebar" aria-label="文章侧边栏">
<section class="sidebar-card article-author-card">
<img class="profile-avatar" src={avatar} alt="biss" loading="lazy" />
<div class="profile-name">biss</div>
<img class="profile-avatar" src={avatar} alt={siteConfig.author.name} loading="lazy" />
<div class="profile-name">{siteConfig.author.name}</div>
<div class="article-author-meta">
<span>{post.dateText}</span>
{post.categories[0] && <a href={getCategoryHref(post.categories[0])}>{post.categories[0]}</a>}