mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 11:03:50 +00:00
30 lines
851 B
Plaintext
30 lines
851 B
Plaintext
---
|
|
import { getCollection } from "astro:content";
|
|
import ContentLayout from "@/layouts/content.astro";
|
|
import { BlogHeader } from "@/components/blog/header";
|
|
import { BlogPostList } from "@/components/blog/post-list";
|
|
|
|
const posts = (await getCollection("blog", ({ data }) => {
|
|
return data.isDraft !== true;
|
|
})).sort((a, b) => {
|
|
return b.data.date.valueOf() - a.data.date.valueOf()
|
|
}).map(post => ({
|
|
...post,
|
|
data: {
|
|
...post.data,
|
|
date: post.data.date.toLocaleDateString("en-US", {
|
|
year: "numeric",
|
|
month: "long",
|
|
day: "numeric"
|
|
})
|
|
}
|
|
}));
|
|
---
|
|
<ContentLayout
|
|
title="Blog | Timothy Pidashev"
|
|
description="My experiences and technical insights into software development and the ever-evolving world of programming."
|
|
>
|
|
<BlogHeader client:load />
|
|
<BlogPostList posts={posts} client:load />
|
|
</ContentLayout>
|