-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathCard.astro
More file actions
31 lines (27 loc) · 843 Bytes
/
Copy pathCard.astro
File metadata and controls
31 lines (27 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
import type { CollectionEntry } from "astro:content";
import { getPostUrl } from "@/utils/getPostPaths";
import { toTransitionName } from "@/utils/toTransitionName";
import Datetime from "./Datetime.astro";
type Props = {
variant?: "h2" | "h3";
} & CollectionEntry<"posts">;
const { variant: Heading = "h2", id, data, filePath } = Astro.props;
const { title, description, ...props } = data;
---
<li class="my-6">
<a
href={getPostUrl(id, filePath, Astro.currentLocale)}
class:list={[
"text-accent inline-block text-lg font-medium",
"decoration-dashed underline-offset-4 hover:underline",
"focus-visible:no-underline focus-visible:underline-offset-0",
]}
>
<Heading transition:name={toTransitionName(id)}>
{title}
</Heading>
</a>
<Datetime {...props} />
<p>{description}</p>
</li>