feat: custom author avatar support

This commit is contained in:
grassblock 2025-05-29 22:18:59 +08:00
parent b103c045e2
commit 047b896ddc
4 changed files with 47 additions and 11 deletions

View file

@ -0,0 +1,13 @@
import {z} from "astro:content";
import {siteConfig} from "../config.ts";
export const authors = ({ image }) => z.object({
name: z.string().default(siteConfig.defaultAuthor.name),
email: z.string().email().default(siteConfig.defaultAuthor.email),
avatar: image().optional(),
mcplayerid: z.string().optional(),
social: z.object({
twitter: z.string().optional(),
fediverse: z.string().optional(),
}).optional(),
});

View file

@ -1,7 +1,8 @@
Wheatley: # the key name (id) of the author, which is used in the front matter
name: "Wheatley" # the display name of the author
email: "hello@example.org" # the email address of the author
mcplayerid: "Wheatley" # the Minecraft player ID of the author, if applicable
avatar: "https://minotar.net/helm/Wheatley/64.png" # the URL of the author's avatar image (takes precedence over the minecraft player avatar, a square image with no more than 64*64 is recommended)
mcplayerid: "Wheatley" # the Minecraft player ID of the author, if applicable (used for generating player avatars)
social: # the social media accounts of the author, if any (there is no reference for this yet except for the twitter handle)
twitter: "@wheatley"
fediverse: "@"