List a person's blog posts on their page
A Blog posts section, the same cards as the Community blog, for the published and listed posts they're an author of. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f797e2c509
commit
7876e060e7
5 changed files with 45 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ import PageShell, { type ShellSection } from '../components/PageShell.tsx'
|
|||
import PageState from '../components/PageState.tsx'
|
||||
import PlatformIcon from '../components/PlatformIcon.tsx'
|
||||
import ContentBlocks from '../components/ContentBlocks.tsx'
|
||||
import { PostCard } from './sections/CommunityBlog.tsx'
|
||||
import {
|
||||
usePerson,
|
||||
type PersonEvent,
|
||||
|
|
@ -190,6 +191,24 @@ export default function PersonDetail() {
|
|||
})
|
||||
}
|
||||
|
||||
if (person.posts?.length > 0) {
|
||||
sections.push({
|
||||
id: 'posts',
|
||||
title: 'Blog posts',
|
||||
accent,
|
||||
background: BACKGROUNDS[sections.length % 2],
|
||||
content: (
|
||||
<div className="max-w-6xl mx-auto px-6">
|
||||
<ul className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{person.posts.map((post) => (
|
||||
<PostCard key={post.id} post={post} accent={accent} />
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<PageShell title={person.name} intro={person.tagline ?? undefined} sections={sections} />
|
||||
)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ const DEFAULTS = {
|
|||
|
||||
const EXCERPT_CHARS = 180
|
||||
|
||||
function PostCard({ post, accent }: { post: BlogPostSummary; accent: string }) {
|
||||
/* One post as a card; person pages list their posts with it too. */
|
||||
export function PostCard({ post, accent }: { post: BlogPostSummary; accent: string }) {
|
||||
const cover = useSmallImage(mediaUrl(post.cover_image))
|
||||
const date = postDate(post.published_on)
|
||||
const authors = post.authors.map((author) => author.name).join(', ')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue