feat(blog): content collection, index, post layout, RSS
Adds the blog system ahead of the launch post: a zod-typed `blog` content collection (content layer glob loader), a card-list index with a calm empty state, the post route/layout with reading time, and an RSS feed — all wired to the existing Base shell and palette. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
1 parent
adca1c5bdf
commit
4a05f364fd
6 files changed
+264
No files matched your search
@@ -0,0 +1,29 @@
|
||||
---
|
||||
import { getCollection, render } from 'astro:content';
|
||||
import Post from '../../layouts/Post.astro';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog', ({ data }) => !data.draft);
|
||||
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.id },
|
||||
props: { post },
|
||||
}));
|
||||
}
|
||||
|
||||
const { post } = Astro.props;
|
||||
const { Content } = await render(post);
|
||||
---
|
||||
|
||||
<Post
|
||||
title={post.data.title}
|
||||
description={post.data.description}
|
||||
pubDate={post.data.pubDate}
|
||||
updatedDate={post.data.updatedDate}
|
||||
author={post.data.author}
|
||||
tags={post.data.tags}
|
||||
heroImage={post.data.heroImage}
|
||||
body={post.body ?? ''}
|
||||
>
|
||||
<Content />
|
||||
</Post>
|
||||
Reference in new issue
Block a user