aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/components/MemberCard.astro (renamed from src/components/AuthorCard.astro)23
-rw-r--r--src/components/PostNavigation.astro6
-rw-r--r--src/consts.ts13
-rw-r--r--src/content.config.ts7
-rw-r--r--src/content/members/enscribe.md (renamed from src/content/authors/enscribe.md)0
-rw-r--r--src/lib/data-utils.ts11
-rw-r--r--src/pages/authors/index.astro27
-rw-r--r--src/pages/members/[...id].astro (renamed from src/pages/authors/[...id].astro)34
-rw-r--r--src/pages/members/index.astro27
9 files changed, 76 insertions, 72 deletions
diff --git a/src/components/AuthorCard.astro b/src/components/MemberCard.astro
index 9f178fa..b98e3ee 100644
--- a/src/components/AuthorCard.astro
+++ b/src/components/MemberCard.astro
@@ -7,20 +7,21 @@ import type { CollectionEntry } from 'astro:content'
import SocialIcons from './SocialIcons.astro'
interface Props {
- author: CollectionEntry<'authors'>
+ member: CollectionEntry<'members'>
}
-const { author } = Astro.props
-const { name, avatar, bio, pronouns } = author.data
+const { member } = Astro.props
+const { name, avatar, bio, pronouns } = member.data
const currentPath = Astro.url.pathname
-const isAuthorPage = currentPath === `/authors/${author.id}`
+const isAuthorPage = currentPath === `/members/${member.id}`
const socialLinks: SocialLink[] = [
- author.data.website && { href: author.data.website, label: 'Website' },
- author.data.github && { href: author.data.github, label: 'GitHub' },
- author.data.twitter && { href: author.data.twitter, label: 'Twitter' },
- author.data.linkedin && { href: author.data.linkedin, label: 'LinkedIn' },
- author.data.mail && { href: `mailto:${author.data.mail}`, label: 'Email' },
+ member.data.website && { href: member.data.website, label: 'Website' },
+ member.data.github && { href: member.data.github, label: 'GitHub' },
+ member.data.codeberg && { href: member.data.codeberg, label: 'Codeberg' },
+ member.data.twitter && { href: member.data.twitter, label: 'Twitter' },
+ member.data.linkedin && { href: member.data.linkedin, label: 'LinkedIn' },
+ member.data.mail && { href: `mailto:${member.data.mail}`, label: 'Email' },
].filter(Boolean) as SocialLink[]
---
@@ -29,7 +30,7 @@ const socialLinks: SocialLink[] = [
>
<div class="flex flex-wrap gap-4">
<Link
- href={`/authors/${author.id}`}
+ href={`/members/${member.id}`}
class={cn('block', isAuthorPage && 'pointer-events-none')}
>
<AvatarComponent
@@ -38,7 +39,7 @@ const socialLinks: SocialLink[] = [
alt={`Avatar of ${name}`}
fallback={name[0]}
className={cn(
- 'size-32 rounded-md [&>[data-slot="avatar-fallback"]]:rounded-md',
+ '.:data-[slot="avatar-fallback"]:rounded-md size-32 rounded-md',
!isAuthorPage &&
'hover:ring-primary transition-shadow duration-300 hover:cursor-pointer hover:ring-2',
)}
diff --git a/src/components/PostNavigation.astro b/src/components/PostNavigation.astro
index bca228a..2e8b93e 100644
--- a/src/components/PostNavigation.astro
+++ b/src/components/PostNavigation.astro
@@ -19,7 +19,8 @@ const isSubpost = !!parentPost
class={cn(
buttonVariants({ variant: 'outline' }),
'rounded-lg group flex items-center justify-start size-full',
- !olderPost && 'pointer-events-none opacity-0 cursor-not-allowed',
+ !olderPost &&
+ 'pointer-events-none opacity-0 invisible cursor-not-allowed',
)}
aria-disabled={!olderPost}
>
@@ -71,7 +72,8 @@ const isSubpost = !!parentPost
class={cn(
buttonVariants({ variant: 'outline' }),
'rounded-lg group flex items-center justify-end size-full',
- !newerPost && 'pointer-events-none opacity-0 cursor-not-allowed',
+ !newerPost &&
+ 'pointer-events-none opacity-0 invisible cursor-not-allowed',
)}
aria-disabled={!newerPost}
>
diff --git a/src/consts.ts b/src/consts.ts
index c66ef3e..58bb71e 100644
--- a/src/consts.ts
+++ b/src/consts.ts
@@ -3,7 +3,7 @@ import type { IconMap, SocialLink, Site } from '@/types'
export const SITE: Site = {
title: 'FOSS CET',
description:
- 'Don\'t just join a club; build one. We need architects, not just members',
+ "Don't just join a club; build one. We need architects, not just members",
href: 'https://astro-erudite.vercel.app',
author: 'fosscet',
locale: 'en-US',
@@ -19,8 +19,8 @@ export const NAV_LINKS: SocialLink[] = [
label: 'blog',
},
{
- href: '/authors',
- label: 'authors',
+ href: '/members',
+ label: 'members',
},
{
href: '/about',
@@ -34,8 +34,8 @@ export const NAV_LINKS: SocialLink[] = [
export const SOCIAL_LINKS: SocialLink[] = [
{
- href: 'https://codeberg.org/foss-cet',
- label: 'CodeBerg',
+ href: 'https://codeberg.org/fosscet',
+ label: 'Codeberg',
},
{
href: '/rss.xml',
@@ -45,7 +45,8 @@ export const SOCIAL_LINKS: SocialLink[] = [
export const ICON_MAP: IconMap = {
Website: 'lucide:globe',
- CodeBerg: 'lucide:mountain-snow',
+ Codeberg: 'lucide:mountain-snow',
+ GitHub: 'lucide:github',
LinkedIn: 'lucide:linkedin',
Twitter: 'lucide:twitter',
Email: 'lucide:mail',
diff --git a/src/content.config.ts b/src/content.config.ts
index 1c01708..d18d704 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -30,8 +30,8 @@ const blog = defineCollection({
}),
})
-const authors = defineCollection({
- loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/authors' }),
+const members = defineCollection({
+ loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/members' }),
schema: z.object({
name: z.string(),
pronouns: z.string().optional(),
@@ -41,6 +41,7 @@ const authors = defineCollection({
website: z.string().url().optional(),
twitter: z.string().url().optional(),
github: z.string().url().optional(),
+ codeberg: z.string().url().optional(),
linkedin: z.string().url().optional(),
discord: z.string().url().optional(),
}),
@@ -60,4 +61,4 @@ const projects = defineCollection({
}),
})
-export const collections = { events, blog, authors, projects }
+export const collections = { events, blog, members, projects }
diff --git a/src/content/authors/enscribe.md b/src/content/members/enscribe.md
index 57cac26..57cac26 100644
--- a/src/content/authors/enscribe.md
+++ b/src/content/members/enscribe.md
diff --git a/src/lib/data-utils.ts b/src/lib/data-utils.ts
index ab0176f..6e4439f 100644
--- a/src/lib/data-utils.ts
+++ b/src/lib/data-utils.ts
@@ -1,8 +1,8 @@
import { getCollection, render, type CollectionEntry } from 'astro:content'
import { readingTime, calculateWordCountFromHtml } from '@/lib/utils'
-export async function getAllAuthors(): Promise<CollectionEntry<'authors'>[]> {
- return await getCollection('authors')
+export async function getAllMembers(): Promise<CollectionEntry<'members'>[]> {
+ return await getCollection('members')
}
export async function getAllPosts(): Promise<CollectionEntry<'blog'>[]> {
@@ -23,8 +23,7 @@ export async function getAllPostsAndSubposts(): Promise<
export async function getAllEvents(): Promise<CollectionEntry<'events'>[]> {
const events = await getCollection('events')
- return events
- .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
+ return events.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
}
export function groupEventsByYear(
@@ -62,7 +61,7 @@ export async function getAllTags(): Promise<Map<string, number>> {
export async function getAllTypes(): Promise<Map<string, number>> {
const events = await getAllEvents()
return events.reduce((acc, event) => {
- acc.set(event.data.type, (acc.get(event.data.type) || 0) + 1)
+ acc.set(event.data.type, (acc.get(event.data.type) || 0) + 1)
return acc
}, new Map<string, number>())
}
@@ -248,7 +247,7 @@ export async function getParentPost(
export async function parseAuthors(authorIds: string[] = []) {
if (!authorIds.length) return []
- const allAuthors = await getAllAuthors()
+ const allAuthors = await getAllMembers()
const authorMap = new Map(allAuthors.map((author) => [author.id, author]))
return authorIds.map((id) => {
diff --git a/src/pages/authors/index.astro b/src/pages/authors/index.astro
deleted file mode 100644
index ba311a0..0000000
--- a/src/pages/authors/index.astro
+++ /dev/null
@@ -1,27 +0,0 @@
----
-import AuthorCard from '@/components/AuthorCard.astro'
-import Breadcrumbs from '@/components/Breadcrumbs.astro'
-import PageHead from '@/components/PageHead.astro'
-import Layout from '@/layouts/Layout.astro'
-import { getAllAuthors } from '@/lib/data-utils'
-
-const authors = await getAllAuthors()
----
-
-<Layout class="max-w-3xl">
- <PageHead slot="head" title="Authors" />
- <Breadcrumbs items={[{ label: 'Authors', icon: 'lucide:users' }]} />
- {
- authors.length > 0 ? (
- <ul class="flex flex-col gap-4">
- {authors.map((author) => (
- <li>
- <AuthorCard author={author} />
- </li>
- ))}
- </ul>
- ) : (
- <p class="text-muted-foreground text-center">No authors found.</p>
- )
- }
-</Layout>
diff --git a/src/pages/authors/[...id].astro b/src/pages/members/[...id].astro
index d71fcf8..8010365 100644
--- a/src/pages/authors/[...id].astro
+++ b/src/pages/members/[...id].astro
@@ -1,46 +1,46 @@
---
-import AuthorCard from '@/components/AuthorCard.astro'
import BlogCard from '@/components/BlogCard.astro'
import Breadcrumbs from '@/components/Breadcrumbs.astro'
+import MemberCard from '@/components/MemberCard.astro'
import PageHead from '@/components/PageHead.astro'
import Layout from '@/layouts/Layout.astro'
-import { getAllAuthors, getPostsByAuthor } from '@/lib/data-utils'
+import { getAllMembers, getPostsByAuthor } from '@/lib/data-utils'
export async function getStaticPaths() {
- const authors = await getAllAuthors()
- return authors.map((author) => ({
- params: { id: author.id },
- props: { author },
+ const members = await getAllMembers()
+ return members.map((member) => ({
+ params: { id: member.id },
+ props: { member },
}))
}
-const { author } = Astro.props
-const authorPosts = await getPostsByAuthor(author.id)
+const { member } = Astro.props
+const memberPosts = await getPostsByAuthor(member.id)
---
<Layout class="max-w-3xl">
<PageHead
slot="head"
- title={`${author.data.name} (Author)`}
- description={author.data.bio || `Profile of ${author.data.name}.`}
+ title={`${member.data.name} (Member)`}
+ description={member.data.bio || `Profile of ${member.data.name}.`}
noindex
/>
<Breadcrumbs
items={[
- { href: '/authors', label: 'Authors', icon: 'lucide:users' },
- { label: author.data.name, icon: 'lucide:user' },
+ { href: '/members', label: 'Members', icon: 'lucide:users' },
+ { label: member.data.name, icon: 'lucide:user' },
]}
/>
<section>
- <AuthorCard author={author} />
+ <MemberCard member={member} />
</section>
<section class="flex flex-col gap-y-4">
- <h2 class="text-2xl font-medium">Posts by {author.data.name}</h2>
+ <h2 class="text-2xl font-medium">Posts by {member.data.name}</h2>
{
- authorPosts.length > 0 ? (
+ memberPosts.length > 0 ? (
<ul class="flex flex-col gap-4">
- {authorPosts
+ {memberPosts
.filter((post) => !post.data.draft)
.map((post) => (
<li>
@@ -50,7 +50,7 @@ const authorPosts = await getPostsByAuthor(author.id)
</ul>
) : (
<p class="text-muted-foreground">
- No posts available from this author.
+ No posts available from this member.
</p>
)
}
diff --git a/src/pages/members/index.astro b/src/pages/members/index.astro
new file mode 100644
index 0000000..04e6d45
--- /dev/null
+++ b/src/pages/members/index.astro
@@ -0,0 +1,27 @@
+---
+import Breadcrumbs from '@/components/Breadcrumbs.astro'
+import MemberCard from '@/components/MemberCard.astro'
+import PageHead from '@/components/PageHead.astro'
+import Layout from '@/layouts/Layout.astro'
+import { getAllMembers } from '@/lib/data-utils'
+
+const members = await getAllMembers()
+---
+
+<Layout class="max-w-3xl">
+ <PageHead slot="head" title="Members" />
+ <Breadcrumbs items={[{ label: 'Members', icon: 'lucide:users' }]} />
+ {
+ members.length > 0 ? (
+ <ul class="flex flex-col gap-4">
+ {members.map((member) => (
+ <li>
+ <MemberCard member={member} />
+ </li>
+ ))}
+ </ul>
+ ) : (
+ <p class="text-muted-foreground text-center">No members found.</p>
+ )
+ }
+</Layout>