feat: add number of posts config for home page (#281)

* Add a SITE config parameter for posts in index page

* docs: update blog post for `postPerIndex` config

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
This commit is contained in:
David Legrand
2024-07-14 09:48:49 +00:00
committed by GitHub
parent 7b045a0be8
commit 0d5ea52c23
4 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ import Hr from "@components/Hr.astro";
import Card from "@components/Card";
import Socials from "@components/Socials.astro";
import getSortedPosts from "@utils/getSortedPosts";
import { SOCIALS } from "@config";
import { SITE, SOCIALS } from "@config";
const posts = await getCollection("blog");
@@ -96,7 +96,7 @@ const socialCount = SOCIALS.filter(social => social.active).length;
<ul>
{recentPosts.map(
({ data, slug }, index) =>
index < 4 && (
index < SITE.postPerIndex && (
<Card
href={`/posts/${slug}/`}
frontmatter={data}