From dcb9350037580d7cdd4a5c6ffd0b8168a5e33958 Mon Sep 17 00:00:00 2001 From: prototypa Date: Sat, 21 Jan 2023 22:29:32 -0500 Subject: [PATCH] Add astro props --- src/components/blog/LatestPosts.astro | 57 +++++++++++++++++++-------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/src/components/blog/LatestPosts.astro b/src/components/blog/LatestPosts.astro index ad8efa7..96244e2 100644 --- a/src/components/blog/LatestPosts.astro +++ b/src/components/blog/LatestPosts.astro @@ -4,27 +4,50 @@ import Grid from '~/components/blog/Grid.astro'; import { getBlogPermalink } from '~/utils/permalinks'; import { findLatestPosts } from '~/utils/blog'; -const count = 4; +export interface Props { + title?: string; + allPostsText?: string; + allPostsLink?: string | URL; + information?: string; + postIds: string[]; +} + +const { + title = await Astro.slots.render('title'), + allPostsText = 'View all posts', + allPostsLink = getBlogPermalink(), + information = await Astro.slots.render('information'), + count = 4, +} = Astro.props; + const posts = await findLatestPosts({ count }); --- -
-
-

- Latest articles in our Blog - -

+
+
+
+ { + title && ( +

+ ) + } + { + allPostsText && allPostsLink && ( + + {allPostsText} ยป + + ) + } +

-

- The blog will be used to display AstroWind documentation. Each new article will be an important step that you will - need to know to be an expert in creating a website using Astro + Tailwind CSS The blog does not exist yet, but - very soon. Astro is a very interesting technology. Thanks. -

+ {information &&

}

-
+
\ No newline at end of file