feat: add external link to articles
Some checks failed
Deploy to SFTP Server / build (push) Failing after 3m13s

This commit is contained in:
Max Richter
2025-10-24 19:08:03 +02:00
parent cf336da3c4
commit 83c099873d
7 changed files with 42 additions and 19 deletions

View File

@@ -2,6 +2,7 @@
export let date: string | Date;
export let readDuration: number | undefined;
export let rating: string | number | undefined;
export let author: string | undefined;
const toDate = (d: string | Date) =>
typeof d === "string" ? new Date(d) : d;
@@ -33,19 +34,28 @@
};
</script>
<div class="flex gap-5">
<div class="flex gap-3 wrapper">
{#if rating}
<div class="text-sm bg-light">{formatRating(rating)}</div>
{/if}
{#if date}
<time class="text-sm text-neutral" datetime={iso(date)}
<time class="text-sm bg-light" datetime={iso(date)}
>{formatDate(date)}</time>
{/if}
{#if typeof readDuration === "number"}
{#if readDuration > 1}
<div class="text-sm text-neutral">{readDuration} mins read</div>
{/if}
{#if readDuration > 1}
<div class="text-sm bg-light">{readDuration} mins read</div>
{/if}
{#if rating}
<div class="text-sm text-neutral">{formatRating(rating)}</div>
{#if author}
<div class="text-sm bg-light">{author}</div>
{/if}
</div>
<style>
.wrapper > * {
padding: 2px 11px;
border-radius: 14px;
font-size: 11px;
opacity: 0.7;
}
</style>