diff --git a/src/components/HomePosts.astro b/src/components/HomePosts.astro index e2d8a9f..3bb3948 100644 --- a/src/components/HomePosts.astro +++ b/src/components/HomePosts.astro @@ -20,5 +20,5 @@ let posts = allPosts --- - + diff --git a/src/components/Post.astro b/src/components/Post.astro deleted file mode 100644 index 2c617e6..0000000 --- a/src/components/Post.astro +++ /dev/null @@ -1,44 +0,0 @@ ---- -import type { CollectionEntry } from "astro:content"; - -interface Props { - post: CollectionEntry<"posts">; -} - -const { - post: { - data: { slug, title, tags, description, added: date }, - }, -}: Props = Astro.props; ---- - -
  • - {title} - -
    - {description &&

    {description}

    } -
    - { - tags && - tags.map((tag: string) => ( - - #{tag} - - )) - } -
    -
  • - - diff --git a/src/components/PostGrid.astro b/src/components/PostGrid.astro index a48a761..8f42290 100644 --- a/src/components/PostGrid.astro +++ b/src/components/PostGrid.astro @@ -3,9 +3,10 @@ import type { CollectionEntry } from "astro:content"; interface Props { posts: CollectionEntry<"posts">[]; + hasRandomPost?: boolean; } -const { posts } = Astro.props; +const { posts, hasRandomPost = false } = Astro.props; const postSlugs = posts.reduce( (slugs, { data: { slug } }) => [slug, ...slugs], @@ -41,18 +42,22 @@ function getTiltDegrees() { )) } -
  • - -
    -

    Bestela, irakurri ausaz aukeratutako post bat 🎲

    -
  • + { + hasRandomPost && ( +
  • + +
    +

    Bestela, irakurri ausaz aukeratutako post bat 🎲

    +
  • + ) + }