|
|
@ -15,7 +15,7 @@ type PostMeta = { |
|
|
|
async function getRecentPosts(): Promise<PostMeta[]> { |
|
|
|
async function getRecentPosts(): Promise<PostMeta[]> { |
|
|
|
const postsDirectory = path.join(process.cwd(), 'content/essays'); |
|
|
|
const postsDirectory = path.join(process.cwd(), 'content/essays'); |
|
|
|
const files = await fs.readdir(postsDirectory); |
|
|
|
const files = await fs.readdir(postsDirectory); |
|
|
|
|
|
|
|
|
|
|
|
const posts = await Promise.all( |
|
|
|
const posts = await Promise.all( |
|
|
|
files |
|
|
|
files |
|
|
|
.filter(file => file.endsWith('.mdx')) |
|
|
|
.filter(file => file.endsWith('.mdx')) |
|
|
@ -23,7 +23,7 @@ async function getRecentPosts(): Promise<PostMeta[]> { |
|
|
|
const fullPath = path.join(postsDirectory, file); |
|
|
|
const fullPath = path.join(postsDirectory, file); |
|
|
|
const fileContents = await fs.readFile(fullPath, 'utf8'); |
|
|
|
const fileContents = await fs.readFile(fullPath, 'utf8'); |
|
|
|
const { data } = matter(fileContents); |
|
|
|
const { data } = matter(fileContents); |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
title: data.title, |
|
|
|
title: data.title, |
|
|
|
createdAt: data.createdAt, |
|
|
|
createdAt: data.createdAt, |
|
|
@ -34,14 +34,14 @@ async function getRecentPosts(): Promise<PostMeta[]> { |
|
|
|
|
|
|
|
|
|
|
|
return posts |
|
|
|
return posts |
|
|
|
.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) |
|
|
|
.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) |
|
|
|
.slice(0, 2); // Get only the 2 most recent posts
|
|
|
|
.slice(0, 4); // Get only the 4 most recent posts
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default async function Home() { |
|
|
|
export default async function Home() { |
|
|
|
const recentPosts = await getRecentPosts(); |
|
|
|
const recentPosts = await getRecentPosts(); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<main className="w-full flex items-center justify-center px-4 mt-14"> |
|
|
|
<main className="w-full flex justify-center px-4 mt-14"> |
|
|
|
<div className="w-full max-w-screen-lg md:px-4 py-8 space-y-8"> |
|
|
|
<div className="w-full max-w-screen-lg md:px-4 py-8 space-y-8"> |
|
|
|
{/* Intro */} |
|
|
|
{/* Intro */} |
|
|
|
<section> |
|
|
|
<section> |
|
|
@ -50,13 +50,21 @@ export default async function Home() { |
|
|
|
<ExternalNav className="flex gap-4" /> |
|
|
|
<ExternalNav className="flex gap-4" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Separator className="-mt-3 mb-4 max-w-[20rem]" /> |
|
|
|
<Separator className="-mt-3 mb-4 max-w-[20rem]" /> |
|
|
|
<p className=""> |
|
|
|
<div className="space-y-4"> |
|
|
|
CEO of{" "} |
|
|
|
<p className=""> |
|
|
|
<ILink href="https://exalaboratories.com" target="_blank"> |
|
|
|
CEO of{" "} |
|
|
|
Exa Laboratories (YC S24) |
|
|
|
<ILink href="https://exalaboratories.com" target="_blank" className="font-bold text-md"> |
|
|
|
</ILink> |
|
|
|
Exa Laboratories (YC S24) |
|
|
|
. Building energy-efficient chips for AI training & inference. |
|
|
|
</ILink> |
|
|
|
</p> |
|
|
|
. Building energy-efficient chips for AI training & inference. |
|
|
|
|
|
|
|
</p> |
|
|
|
|
|
|
|
<p> |
|
|
|
|
|
|
|
I'm a dropout, autodidactic polymath, and this is my digital notebook. Everything here is written by me, and everything here is my own opinion or philosophical beliefs. They are not intended to be taken at face value, but rather as a medium for me to personally reflect on my own thoughts as a therapeutic exercise, or just for fun. |
|
|
|
|
|
|
|
</p> |
|
|
|
|
|
|
|
<p> |
|
|
|
|
|
|
|
Based in the <ILink href="https://en.wikipedia.org/wiki/Silicon_Valley" target="_blank" className="font-bold text-md">Silicon Valley</ILink> (<ILink href="https://en.wikipedia.org/wiki/Bay_Area" target="_blank" className="font-bold text-md">San Francisco Bay Area</ILink>), <ILink href="https://en.wikipedia.org/wiki/United_States" target="_blank" className="font-bold text-md">United States</ILink>. Originally from <ILink href="https://en.wikipedia.org/wiki/M%C3%B6lndal" target="_blank" className="font-bold text-md">Mölndal</ILink>/<ILink href="https://en.wikipedia.org/wiki/Gothenburg" target="_blank" className="font-bold text-md">Gothenburg</ILink>, <ILink href="https://en.wikipedia.org/wiki/Sweden" target="_blank" className="font-bold text-md">Sweden</ILink>. |
|
|
|
|
|
|
|
</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
|
|
|
|
|
|
|
|
{/* Recent Essays */} |
|
|
|
{/* Recent Essays */} |
|
|
@ -70,7 +78,7 @@ export default async function Home() { |
|
|
|
<ul className="space-y-4"> |
|
|
|
<ul className="space-y-4"> |
|
|
|
{recentPosts.map((post) => ( |
|
|
|
{recentPosts.map((post) => ( |
|
|
|
<li key={post.slug}> |
|
|
|
<li key={post.slug}> |
|
|
|
<Link
|
|
|
|
<Link |
|
|
|
href={`/essays/${post.slug}`} |
|
|
|
href={`/essays/${post.slug}`} |
|
|
|
className="block hover:bg-gray-50 dark:hover:bg-gray-800 p-4 rounded-lg transition" |
|
|
|
className="block hover:bg-gray-50 dark:hover:bg-gray-800 p-4 rounded-lg transition" |
|
|
|
> |
|
|
|
> |
|
|
|