1---
2// SPDX-FileCopyrightText: 2025 Norbert Melzer
3// SPDX-FileContributor: Norbert Melzer
4//
5// SPDX-License-Identifier: MIT
6
7import { getEntry, type CollectionEntry } from "astro:content";
8
9import { postPath, authorPath } from "../scripts/paths";
10import Date from "../components/Date.astro";
11
12export interface Props {
13 post: CollectionEntry<"blog">;
14}
15
16const { post } = Astro.props;
17
18const author = await getEntry(post.data.author);
19---
20
21<div class:list={["p-1", "min-h-[150px]", "min-h-[150px]"]}>
22 <div class:list={["flex", "flex-col", "md:flex-row", "justify-between"]}>
23 <h2
24 class:list={[
25 "flex",
26 "text-3xl",
27 "font-extrabold",
28 "text-[--highlight-color]",
29 ]}
30 >
31 <a class:list={["hover:underline"]} href={postPath(post)}
32 >{post.data.title}</a
33 >
34 </h2>
35 <div
36 class:list={[
37 "flex",
38 "flex-col",
39 "text-[color-mix(in_srgb,var(--highlight-color),var(--text-color)_50%)]",
40 ]}
41 >
42 <span class:list={["md:text-right"]}>
43 <Date datetime={post.data.date.toISOString()} />
44 </span>
45 <span class:list={["md:text-right", "text-nowrap"]}>
46 <a href={authorPath(author)}>
47 {author.data.first_name}
48 {author.data.last_name}
49 </a>
50 </span>
51 </div>
52 </div>
53 <div>
54 {/* TODO: provide the hero image */}
55 {post.data.description}
56 </div>
57</div>