0
mirror of https://github.com/valentineus/popov.link.git synced 2025-07-04 08:30:27 +03:00

refactor: update blog layout and components

- Removed the PostSummary component and replaced it with a new PostElement component for better post display.
- Introduced SocialLinks and Welcome sections to enhance the homepage layout.
- Updated the index page to utilize the new sections, improving overall structure and user experience.
This commit is contained in:
2025-06-11 16:34:34 +00:00
parent 3d6aedd272
commit 604e507b31
5 changed files with 88 additions and 60 deletions

View File

@ -1,17 +1,10 @@
---
import { getCollection } from "astro:content";
import Layout from "../layouts/BaseLayout.astro";
import PostSummary from "../components/PostSummary.astro";
const posts = await getCollection("blog", ({ data }) => {
return data.draft !== true;
});
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
import SocialLinksSection from "../components/Sections/SocialLinks.astro";
import WelcomeSection from "../components/Sections/Welcome.astro";
---
<Layout>
<section style={{ "margin-top": "3rem" }}>
{posts.map((post) => <PostSummary post={post} />)}
</section>
<WelcomeSection />
<SocialLinksSection />
</Layout>