From 28a5aa78808f256ae89375cf127a2c241a2d931b Mon Sep 17 00:00:00 2001 From: "Fredys M. Borges" Date: Wed, 27 Dec 2023 11:47:19 -0500 Subject: [PATCH] corrgiendo detalles del codigo --- src/pages/blog/[slug].astro | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/pages/blog/[slug].astro diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro new file mode 100644 index 00000000..16eb89be --- /dev/null +++ b/src/pages/blog/[slug].astro @@ -0,0 +1,43 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import HorizontalCard from "../../components/HorizontalCard.astro"; +import { getCollection } from "astro:content"; + +export async function getStaticPaths({ paginate }) { + const posts = await getCollection("blog"); + posts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); + return paginate(posts, { pageSize: 10 }); +} + +const { page } = Astro.props; +--- + + +
+
Blog
+
+ + + + + + + + + +