optimize posts images and other improvements

This commit is contained in:
Juan Carlos Manzanero Domínguez
2024-06-25 17:13:28 -06:00
parent 9c3e631c78
commit ec3bccb0de
13 changed files with 80 additions and 100 deletions

View File

@@ -1,13 +1,11 @@
---
import PostItem from "@/components/post-item";
import Layout from "@/layouts/Layout.astro";
import { sortContentByDate } from "@/utils/sorts";
import { getCollection } from "astro:content";
const allPosts = await getCollection("blog", ({ data }) => data.draft !== true);
allPosts.sort(
(a, b) =>
Date.parse(b.data.date.toString()) - Date.parse(a.data.date.toString()),
);
sortContentByDate(allPosts);
---
<Layout title="Blog" description="Check my projects.">
@@ -17,7 +15,7 @@ allPosts.sort(
</section>
<ul class="mt-4 flex flex-col gap-4">
{
allPosts.map((blogpost) => (
allPosts.map((blogpost: any) => (
<li>
<PostItem
type="blog"