summaryrefslogtreecommitdiff
path: root/src/lib/components/PostCard.svelte
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-02-09 00:47:32 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-02-09 00:47:32 +0300
commit2f74411118c35f0c9d852966af25e04b45dd3f53 (patch)
treec4ab5c61475294020832cc24bc2931a368fb3d0d /src/lib/components/PostCard.svelte
parent169ab22e65874ecfd9c047d60934220b60a86f15 (diff)
formatting and more perf
Diffstat (limited to 'src/lib/components/PostCard.svelte')
-rw-r--r--src/lib/components/PostCard.svelte38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/components/PostCard.svelte b/src/lib/components/PostCard.svelte
index 7fb9361..83ae71d 100644
--- a/src/lib/components/PostCard.svelte
+++ b/src/lib/components/PostCard.svelte
@@ -1,27 +1,27 @@
<script lang="ts">
- import type { Post } from "$lib/utils/posts";
+ import type { Post } from "$lib/utils/posts";
- interface Props {
- post: Post;
- }
+ interface Props {
+ post: Post;
+ }
- let { post }: Props = $props();
+ let { post }: Props = $props();
- function formatDate(dateStr: string): string {
- return new Date(dateStr).toLocaleDateString("en-US", {
- year: "numeric",
- month: "long",
- day: "numeric",
- });
- }
+ function formatDate(dateStr: string): string {
+ return new Date(dateStr).toLocaleDateString("en-US", {
+ year: "numeric",
+ month: "long",
+ day: "numeric",
+ });
+ }
</script>
<article>
- <header>
- <a href="/posts/{post.slug}">
- <h1 style="text-decoration: none;">{post.title}</h1>
- </a>
- <small><time datetime={post.date}>{formatDate(post.date)}</time></small>
- </header>
- <p>{post.description}</p>
+ <header>
+ <a href="/posts/{post.slug}">
+ <h1 style="text-decoration: none;">{post.title}</h1>
+ </a>
+ <small><time datetime={post.date}>{formatDate(post.date)}</time></small>
+ </header>
+ <p>{post.description}</p>
</article>