This commit is contained in:
Bethlenfalvi, Lorinc (ext)
2025-01-29 12:34:19 +01:00
parent c557a6a132
commit 8dc4d7837f
3 changed files with 7 additions and 8 deletions

View File

@@ -71,7 +71,7 @@
{post.data.author}
</address>
<div class="inline-block post-meta col-start-3 lg:ml-1">
<Time time={parseTime(post.data.pubDate)} />
<Time datetime={post.data.pubDate} />
</div>
<div class="col-span-3">{post.data.summary}</div>
</div>

View File

@@ -1,12 +1,13 @@
<script lang="ts">
import type { Temporal } from "@js-temporal/polyfill";
import { printTime } from "../utils/time";
import { parseTime, printTime } from "../utils/time";
interface Props {
time: Temporal.ZonedDateTime
datetime: string
}
const { time }: Props = $props();
const { datetime }: Props = $props();
const time = $derived(parseTime(datetime));
</script>
<time datetime={time.toString()} class="post-meta inline-block col-start-3">

View File

@@ -13,11 +13,9 @@ const { title, author, summary, pubDate, updatedDate } = Astro.props;
<header class="lg:grid grid-cols-[auto_auto_minmax(300px,_1fr)] grid-rows-[auto_auto]">
<h2 class="font-bold row-span-2 text-2xl m-2 mt-3">{title}</h2>
<address class="post-meta inline-block col-start-2">{author}</address>
<Time client:load time={parseTime(pubDate)} />
<Time client:load time={pubDate} />
<div class="italic tracking-[3px] text-emph-fg col-start-2 col-span-2 m-2 mt-0">{summary}</div>
{updatedDate && <div>
Amended <Time time={parseTime(updatedDate)} />
</div>}
{updatedDate && <div>Amended <Time time={updatedDate} /></div>}
</header>
<hr class="mb-3">
<main class="max-w-[100ch] font-prose post-content">