feat: prefer author's custom avatar over the default skin avatar

This commit is contained in:
草师傅 2025-08-15 20:56:51 +08:00
parent ee714021e6
commit 582bc128d4
Signed by: gb
GPG key ID: 43330A030E2D6478
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@ import {siteConfig} from "../../../config";
const { data } = Astro.props;
// Get author data
const authorAvatar = data.mcplayerid ? `/images/avatars/${data.mcplayerid}.png` : (data.avatar ? data.avatar : null);
const authorAvatar = data.avatar ? data.avatar : (data.mcplayerid ? `/images/avatars/${data.mcplayerid}.png` : null);
const authorName = data.name ? data.name : null;
---
{(siteConfig.displayAvatar && data) &&

View file

@ -92,8 +92,8 @@ export async function GET({ props }) {
const { author } = props;
const authorId = author.id;
// Try to retrieve from cache first
if (author.data.avatar) {
// Try to retrieve from cache first
const cacheKey = `avatar-${authorId}`;
const cachedAvatar = await getCachedAvatar(cacheKey);