46 lines
2.5 KiB
Plaintext
46 lines
2.5 KiB
Plaintext
---
|
|
import { getCollection, render } from 'astro:content';
|
|
import type { GetStaticPaths } from 'astro';
|
|
import Base from '../../layouts/Base.astro';
|
|
import Button from '../../components/Button.astro';
|
|
import Label from '../../components/Label.astro';
|
|
|
|
export const getStaticPaths = (async () => {
|
|
const all = (await getCollection('projects')).sort((a, b) => a.data.order - b.data.order);
|
|
return all.map((entry, i) => ({
|
|
params: { slug: entry.id },
|
|
props: { entry, prev: all[i - 1], next: all[i + 1], n: i + 1 },
|
|
}));
|
|
}) satisfies GetStaticPaths;
|
|
|
|
const { entry, prev, next, n } = Astro.props;
|
|
const { Content } = await render(entry);
|
|
const d = entry.data;
|
|
---
|
|
|
|
<Base title={`${d.title} — Dylan Benzi`} description={d.summary}>
|
|
<article class="pt-10" data-domain={d.domain}>
|
|
<a class="font-mono text-[13px] text-muted hover:text-amber" href="/#projects">← ALL PROJECTS</a>
|
|
<h1 class="mt-5 mb-3 border-l-8 border-(color:--dc) pl-[18px] text-[44px] leading-[1.1] font-bold tracking-[-0.02em] max-sm:text-[30px]">{d.title}</h1>
|
|
<p class="max-w-[60ch] text-[20px] text-body">{d.summary}</p>
|
|
<div class="my-7 flex flex-wrap gap-px border border-line bg-line">
|
|
<div class="flex-[1_1_160px] bg-panel px-5 py-3.5"><Label>NO.</Label><div class="mt-1.5 font-mono text-[14px]">{String(n).padStart(2, '0')}</div></div>
|
|
<div class="flex-[1_1_160px] bg-panel px-5 py-3.5"><Label>DOMAIN</Label><div class="mt-1.5 font-mono text-[14px] text-(color:--dc)">{d.domainLabel}</div></div>
|
|
<div class="flex-[1_1_160px] bg-panel px-5 py-3.5"><Label>{d.whenLabel}</Label><div class="mt-1.5 font-mono text-[14px]">{d.when}</div></div>
|
|
{d.tech.length > 0 && <div class="flex-[1_1_320px] bg-panel px-5 py-3.5"><Label>TECH</Label><div class="mt-1.5 font-mono text-[14px]">{d.tech.join(' · ')}</div></div>}
|
|
</div>
|
|
<div class="max-w-[68ch] text-[17px] text-body [&_a]:text-accent [&_h2]:mt-8 [&_h2]:mb-2.5 [&_h2]:text-[24px] [&_h2]:font-semibold [&_h2]:tracking-[-0.02em] [&_h2]:text-fg [&_li]:my-1"><Content /></div>
|
|
{
|
|
d.links.length > 0 && (
|
|
<div class="mt-7 flex flex-wrap gap-3">
|
|
{d.links.map((l) => <Button href={l.href}>{l.label} ↗</Button>)}
|
|
</div>
|
|
)
|
|
}
|
|
<div class="my-14 flex flex-wrap justify-between gap-3">
|
|
{prev ? <Button href={`/projects/${prev.id}/`}>← {prev.data.title}</Button> : <span />}
|
|
{next ? <Button href={`/projects/${next.id}/`}>{next.data.title} →</Button> : <span />}
|
|
</div>
|
|
</article>
|
|
</Base>
|