diff options
author | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-06-24 12:08:41 -0300 |
---|---|---|
committer | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-06-24 12:50:43 -0300 |
commit | f9a77c5c27aede4e5978eb55d9b7af781b680a1d (patch) | |
tree | d545e325ba1ae756fc2eac66fac1001b6753c40d /src/components/BlogCard.astro |
feat!: initial commit
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
Diffstat (limited to 'src/components/BlogCard.astro')
-rw-r--r-- | src/components/BlogCard.astro | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/components/BlogCard.astro b/src/components/BlogCard.astro new file mode 100644 index 0000000..7ab42d7 --- /dev/null +++ b/src/components/BlogCard.astro @@ -0,0 +1,38 @@ +--- +import type { CollectionEntry } from "astro:content"; + +interface Props extends CollectionEntry<"blog"> {} + +const { id, data } = Astro.props; +const { title, description, dateCreated, lang } = data; + +const href = `/blog/read/${id}`; +--- + +<article> + <h2> + <a {href}>{title}</a> + </h2> + <p>{description}</p> + <footer> + <span><time datetime={(dateCreated as Date).toISOString()}>{ + new Intl.DateTimeFormat(lang, { + weekday: "long", + year: "numeric", + month: "long", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + timeZoneName: "long", + }).format(dateCreated) + }</time></span> + </footer> +</article> + +<style> + article { + border-block-end: 1px solid #181818; + padding-block-end: 1rem; + margin-block: 0.5rem; + } +</style> |