refactor: moves apps outside of apps/ path

This commit is contained in:
Lewis Wynne 2026-01-29 02:34:45 +00:00
parent b2d1a5ae9e
commit c85e2e2357
45 changed files with 4 additions and 3 deletions

View file

@ -0,0 +1,30 @@
---
import { getCollection, render } from 'astro:content';
import Layout from '../../layouts/Layout.astro';
export async function getStaticPaths() {
const posts = await getCollection('posts', ({ data }) => data.draft !== true);
return posts.map(post => ({
params: { slug: post.id },
props: { post }
}));
}
const { post } = Astro.props;
const { Content } = await render(post);
function formatDate(date: Date): string {
const d = String(date.getDate()).padStart(2, '0');
const m = String(date.getMonth() + 1).padStart(2, '0');
const y = String(date.getFullYear()).slice(-2);
return `${d}/${m}/${y}`;
}
---
<Layout title={`${post.data.title} - lewis m.w.`}>
<article>
<h1>{post.data.title}</h1>
<p class="muted" style="margin-top: 0;">{formatDate(post.data.date)}</p>
<Content />
</article>
</Layout>