From 36d119f27533abc31f18a6d6f90a82b6ed53a264 Mon Sep 17 00:00:00 2001 From: madcampos Date: Wed, 4 Sep 2024 14:45:40 -0400 Subject: [PATCH 1/4] feat: add author pronouns --- src/content/authors/drey.md | 1 + src/content/authors/marco.md | 1 + src/schemas/authors.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/content/authors/drey.md b/src/content/authors/drey.md index 7a509f7..8983fa7 100644 --- a/src/content/authors/drey.md +++ b/src/content/authors/drey.md @@ -1,6 +1,7 @@ --- name: drey moreau avatar: ./assets/drey.jpg +pronouns: they/them avatarAlt: A picture of drey's face at sunrise. email: drey@torontojs.com website: https://dreymoreau.netlify.app diff --git a/src/content/authors/marco.md b/src/content/authors/marco.md index a08a2ae..eac34fd 100644 --- a/src/content/authors/marco.md +++ b/src/content/authors/marco.md @@ -1,6 +1,7 @@ --- name: Marco Campos avatar: ./assets/marco.jpg +pronouns: he/him avatarAlt: A picture of my face with a smile looking at the camera. I'm wearing aviator glasses, a fake fur winter hat and an orange scarf. email: me@madcampos.dev website: https://madcampos.dev/ diff --git a/src/schemas/authors.ts b/src/schemas/authors.ts index 45acb18..a43fe5a 100644 --- a/src/schemas/authors.ts +++ b/src/schemas/authors.ts @@ -2,6 +2,7 @@ import { type SchemaContext, z as zod } from 'astro:content'; export const authorsSchema = ({ image }: SchemaContext) => zod.object({ name: zod.string().describe('The author\'s name.'), + pronouns: zod.string().optional().describe('The author\'s pronouns.'), avatar: image().describe('The avatar image to use when displaying cards.'), avatarAlt: zod.string().describe('The avatar image alt text.'), email: zod.string().email().optional().describe('The author\'s email, if they want to share.'), From f43acd552768f09bd712712e8699db1982d7f0f3 Mon Sep 17 00:00:00 2001 From: madcampos Date: Wed, 4 Sep 2024 14:54:21 -0400 Subject: [PATCH 2/4] feat: add prionouns to author card --- src/components/AuthorCard/index.astro | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/AuthorCard/index.astro b/src/components/AuthorCard/index.astro index e119be2..202aa2f 100644 --- a/src/components/AuthorCard/index.astro +++ b/src/components/AuthorCard/index.astro @@ -16,7 +16,7 @@ const { author } = Astro.props; const BLOG_URL = Astro.site?.href; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -const { data: { avatar, avatarAlt, name }, body } = (await getEntry('authors', author))!; +const { data: { avatar, avatarAlt, name, pronouns }, body } = (await getEntry('authors', author))!; const description = await parseMarkdown(body); ---