/* ═══════════════════════════════════════════════════════════════ COMMUNITY BLOG The Community page's blog section (Admin → Pages → Community blog section). Two halves, each pinned first and then newest, as routes/blog.js decides: our posts cards for our own /blog/:id pages community posts featured cards (pinned by hand, or the newest from the listed feeds), drawn by FeaturedCards, with a button to the Substack The section's heading and blurb come from the same record; the page reads them through the same cached request (Community.tsx). A half with nothing in it isn't drawn. ═══════════════════════════════════════════════════════════════ */ import { Link } from 'react-router-dom' import FeaturedCards from '../../components/FeaturedCards.tsx' import PlatformIcon from '../../components/PlatformIcon.tsx' import { blogHref } from '../../lib/hrefs.ts' import { mediaUrl } from '../../lib/media.ts' import { preview } from '../../lib/text.ts' import { postDate, useCommunityBlog, type BlogPostSummary } from '../../lib/useBlog.ts' import HomeLink from './home/HomeLink.tsx' import { accentText, BRAND } from '../../lib/color.ts' import { useSmallImage } from '../../lib/useSmallImage.ts' /* Headings for a half the admin didn't title. */ const DEFAULTS = { internal: 'From NGU', external: 'From our community', externalLabel: 'Read more on Substack', } const EXCERPT_CHARS = 180 /* 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(', ') return (
{[date, ...post.tags].filter(Boolean).join(' · ')}
)}{preview(post.excerpt, EXCERPT_CHARS)}
)} {authors &&By {authors}
}· Posts coming soon ·
} return (