MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / PostCard

Function PostCard

examples/next-images/app/page.tsx:6–27  ·  view source on GitHub ↗
(post: Post)

Source from the content-addressed store, hash-verified

4import { getMDXComponent } from "next-contentlayer/hooks";
5
6function PostCard(post: Post) {
7 const Content = getMDXComponent(post.body.code);
8
9 return (
10 <div className="mb-8">
11 <h2 className="text-xl">
12 <Link
13 href={post.url}
14 className="text-blue-700 hover:text-blue-900"
15 legacyBehavior>
16 {post.title}
17 </Link>
18 </h2>
19 <time dateTime={post.date} className="block mb-2 text-xs text-gray-600">
20 {format(parseISO(post.date), "LLLL d, yyyy")}
21 </time>
22 <div className="text-sm">
23 <Content />
24 </div>
25 </div>
26 );
27}
28
29export default function Home() {
30 const posts = allPosts.sort((a, b) =>

Callers

nothing calls this directly

Calls 1

getMDXComponentFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…