diff options
author | Valentin Popov <valentin@popov.link> | 2025-06-10 17:20:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-10 17:20:48 +0300 |
commit | d74eec1c47a0d4da5c50b70da3fedbdef0cafcc6 (patch) | |
tree | affd620f3ea07a9054284b7baafbcd9bc33a1879 /src/components/PostElement.astro | |
parent | d32248742050d59baf83c17a6c6566b3ecdf5614 (diff) | |
parent | 9ebcd40f60ffa393a56db850b6a6d0cf15ef4211 (diff) | |
download | popov.link-d74eec1c47a0d4da5c50b70da3fedbdef0cafcc6.tar.xz popov.link-d74eec1c47a0d4da5c50b70da3fedbdef0cafcc6.zip |
Merge pull request #48 from valentineus/header
New Header
Diffstat (limited to 'src/components/PostElement.astro')
-rw-r--r-- | src/components/PostElement.astro | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/components/PostElement.astro b/src/components/PostElement.astro new file mode 100644 index 0000000..703189e --- /dev/null +++ b/src/components/PostElement.astro @@ -0,0 +1,32 @@ +--- +import { type CollectionEntry } from "astro:content"; +import dayjs from "dayjs"; + +type Props = { + readonly post: CollectionEntry<"blog">; +}; + +const { post } = Astro.props; +const { remarkPluginFrontmatter } = await post.render(); +const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"); +--- + +<style lang="scss"> + @import "../scss/_variables.scss"; + + small { + font-size: $fontSizeBase * 0.75; + opacity: 0.5; + } +</style> + +<li> + <a href={`/blog/${post.slug}`}>{post.data.title}</a> + <div> + <small> + <time datetime={post.data.pubDate.toISOString()}>{formattedDate}</time> + <span>•</span> + <span>{remarkPluginFrontmatter.minutesRead}</span> + </small> + </div> +</li> |