mirror of
https://github.com/valentineus/popov.link.git
synced 2025-07-04 00:20:26 +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:
@ -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>
|
||||
|
Reference in New Issue
Block a user