---
import { getCollection } from "astro:content";
import Layout from "@/layouts/Layout.astro";
import Header from "@/components/Header.astro";
import Footer from "@/components/Footer.astro";
import Socials from "@/components/Socials.astro";
import LinkButton from "@/components/LinkButton.astro";
import Card from "@/components/Card.astro";
import Hr from "@/components/Hr.astro";
import getSortedPosts from "@/utils/getSortedPosts";
import IconRss from "@/assets/icons/IconRss.svg";
import IconArrowRight from "@/assets/icons/IconArrowRight.svg";
import { SITE } from "@/config";
import { SOCIALS } from "@/constants";
const posts = await getCollection("blog");
const sortedPosts = getSortedPosts(posts);
const featuredPosts = sortedPosts.filter(({ data }) => data.featured);
const recentPosts = sortedPosts.filter(({ data }) => !data.featured);
---
{SITE.title}
RSS Feed
{SITE.desc}
{
// only display if at least one social link is enabled
SOCIALS.length > 0 && (
)
}
{
featuredPosts.length > 0 && (
<>
Featured
{featuredPosts.map(data => (
))}
{recentPosts.length > 0 &&
}
>
)
}
{
recentPosts.length > 0 && (
Recent Posts
{recentPosts.map(
(data, index) =>
index < SITE.postPerIndex &&
)}
)
}
All Posts