From 582bc128d43846de211e02e768d1221c19c0f657 Mon Sep 17 00:00:00 2001 From: grassblock Date: Fri, 15 Aug 2025 20:56:51 +0800 Subject: [PATCH] feat: prefer author's custom avatar over the default skin avatar --- src/components/helper/authors/Info.astro | 2 +- src/pages/images/avatars/[author].png.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/helper/authors/Info.astro b/src/components/helper/authors/Info.astro index f660050..e26b7c6 100644 --- a/src/components/helper/authors/Info.astro +++ b/src/components/helper/authors/Info.astro @@ -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) && diff --git a/src/pages/images/avatars/[author].png.js b/src/pages/images/avatars/[author].png.js index b449d56..e9afc01 100644 --- a/src/pages/images/avatars/[author].png.js +++ b/src/pages/images/avatars/[author].png.js @@ -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);