MCPcopy Create free account
hub / github.com/TejasQ/tejaskumar.com / Blog

Function Blog

pages/blog.tsx:13–55  ·  view source on GitHub ↗
({ posts }: { posts: Post[] })

Source from the content-addressed store, hash-verified

11import { getInitialBlogPosts, Post } from "../util/getInitialBlogPosts";
12
13const Blog = ({ posts }: { posts: Post[] }) => (
14 <>
15 <Head>
16 <title>Blog : Tejas Kumar | Speaker, Engineer, JavaScript, Love</title>
17 <meta
18 name="description"
19 content="Personal blog of Tejas Kumar – an award-winning web developer and international speaker."
20 />
21 </Head>
22 <Title
23 style={{
24 zIndex: -1,
25 position: "absolute",
26 transform: "translateY(-50%)",
27 }}
28 color="#0002"
29 length={4}
30 >
31 BLOG BLOG BLOG BLOG
32 </Title>
33 <div className={styles.container}>
34 {posts &&
35 posts.map(post => (
36 <Link
37 key={post.title}
38 href="/blog/[post]"
39 as={`/blog/${encodeURI(post.slug)}`}
40 >
41 <Card className={styles.blogCard}>
42 <h2>{title(post.title)}</h2>
43 <BlogMeta>
44 <ReadingTime text={post.body} />
45 </BlogMeta>
46 <ReactMarkdown>{post.excerpt}</ReactMarkdown>
47 <p>
48 <a href={`/blog/${encodeURI(post.slug)}`}>Keep reading... 👉🏾</a>
49 </p>
50 </Card>
51 </Link>
52 ))}
53 </div>
54 </>
55);
56
57export async function getStaticProps() {
58 return { props: await getInitialBlogPosts() };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected