diff --git a/src/components/HomePosts.astro b/src/components/HomePosts.astro index 3e5b829..e2d8a9f 100644 --- a/src/components/HomePosts.astro +++ b/src/components/HomePosts.astro @@ -1,6 +1,5 @@ --- import type { CollectionEntry } from "astro:content"; -import Post from "../components/Post.astro"; import PostGrid from "./PostGrid.astro"; interface Props { @@ -17,7 +16,7 @@ let posts = allPosts new Date(b.data.updated || b.data.added).valueOf() - new Date(a.data.updated || a.data.added).valueOf(), ) - .slice(0, 8); + .slice(0, 7); --- diff --git a/src/components/PostGrid.astro b/src/components/PostGrid.astro index b665d99..6e557d7 100644 --- a/src/components/PostGrid.astro +++ b/src/components/PostGrid.astro @@ -7,6 +7,11 @@ interface Props { const { posts } = Astro.props; +const postSlugs = posts.reduce( + (slugs, { data: { slug } }) => [slug, ...slugs], + [], +); + function getTiltDegrees() { const degreeCollection = [0.5, 1, 1.5, 2]; const randomKey = Math.floor(Math.random() * degreeCollection.length); @@ -35,8 +40,32 @@ function getTiltDegrees() { )) } + +
  • + +
    + Bestela, irakurri ausaz aukeratutako post bat 🎲 +
  • + +