add videos page, new video

This commit is contained in:
juancmandev
2024-07-25 16:03:52 -06:00
parent 2051c76f48
commit d0ab9db2a8
9 changed files with 313 additions and 62 deletions

View File

@@ -4,27 +4,32 @@ import Layout from "@/layouts/Layout.astro";
import { sortContentByDate } from "@/utils/sorts";
import { getCollection } from "astro:content";
const pageData = {
title: "Blog",
description: "Long format about thoughts and other topics.",
};
const allPosts = await getCollection("blog", ({ data }) => data.draft !== true);
sortContentByDate(allPosts);
---
<Layout title="Blog" description="Check my projects.">
<section class="prose prose-invert">
<h1>Blog</h1>
<p>Long format about thoughts and other topics.</p>
</section>
<ul class="mt-4 flex flex-col gap-4">
{
allPosts.map((blogpost: any) => (
<li>
<PostItem
type="blog"
slug={blogpost.slug}
date={blogpost.data.date!}
title={blogpost.data.title!}
/>
</li>
))
}
</ul>
<Layout {...pageData}>
<section class="prose prose-invert">
<h1>{pageData.title}</h1>
<p>{pageData.description}</p>
</section>
<ul class="mt-4 flex flex-col gap-4">
{
allPosts.map((blogpost: any) => (
<li>
<PostItem
type="blog"
slug={blogpost.slug}
date={blogpost.data.date!}
title={blogpost.data.title!}
/>
</li>
))
}
</ul>
</Layout>