feat: prefer author's custom avatar over the default skin avatar
This commit is contained in:
parent
ee714021e6
commit
582bc128d4
2 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ import {siteConfig} from "../../../config";
|
||||||
const { data } = Astro.props;
|
const { data } = Astro.props;
|
||||||
|
|
||||||
// Get author data
|
// 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;
|
const authorName = data.name ? data.name : null;
|
||||||
---
|
---
|
||||||
{(siteConfig.displayAvatar && data) &&
|
{(siteConfig.displayAvatar && data) &&
|
||||||
|
|
|
@ -92,8 +92,8 @@ export async function GET({ props }) {
|
||||||
const { author } = props;
|
const { author } = props;
|
||||||
const authorId = author.id;
|
const authorId = author.id;
|
||||||
|
|
||||||
// Try to retrieve from cache first
|
|
||||||
if (author.data.avatar) {
|
if (author.data.avatar) {
|
||||||
|
// Try to retrieve from cache first
|
||||||
const cacheKey = `avatar-${authorId}`;
|
const cacheKey = `avatar-${authorId}`;
|
||||||
const cachedAvatar = await getCachedAvatar(cacheKey);
|
const cachedAvatar = await getCachedAvatar(cacheKey);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue