astro-template/src/pages/blog/[...slug].astro
Nicholai d10198a3b6 refactor: simplify Astro template to minimal components
- Remove elaborate UI components (CustomCursor, SearchDialog, GridOverlay, ThemeToggle, ThemePreferenceDialog, Navigation, Footer, section components, blog components)
- Strip portfolio and section content
- Reduce global.css to basic typography and prose
- Simplify BaseHead and BlogCard components
- Update content config to only blog collection
- Update README and CLAUDE.md with minimal guidance
- Adjust routes to basic pages (index, blog, contact, 404)
- Delete unused files (dev/injection.md, dev/open-source-vfx-pipeline.mdx, etc.)
2025-12-27 05:22:01 -07:00

27 lines
631 B
Plaintext

---
import { type CollectionEntry, getCollection, render } from 'astro:content';
import BlogPost from '../../layouts/BlogPost.astro';
import { calculateReadingTime } from '../../utils/reading-time';
export async function getStaticPaths() {
const posts = await getCollection('blog');
return posts.map((post) => ({
params: { slug: post.id },
props: { post },
}));
}
interface Props {
post: CollectionEntry<'blog'>;
}
const { post } = Astro.props;
const { Content } = await render(post);
const readTimeText = calculateReadingTime(post.body);
---
<BlogPost {...post.data} readTime={readTimeText}>
<Content />
</BlogPost>