mirror of
https://github.com/valentineus/popov.link.git
synced 2025-08-13 09:56:39 +03:00
- Replaced `pubDate` with `datePublished` in blog post components for consistency. - Updated sorting logic in blog sections to use `datePublished`. - Enhanced blog post schema to include `dateModified` for better structured data representation. - Adjusted various blog markdown files to reflect the new date fields.
41 lines
840 B
Plaintext
41 lines
840 B
Plaintext
---
|
|
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.datePublished.toString()).format("MMMM DD, YYYY");
|
|
const datePublished = post.data.datePublished.toISOString();
|
|
---
|
|
|
|
<style lang="scss">
|
|
@use "../scss/variables" as *;
|
|
|
|
a {
|
|
color: $colorText;
|
|
}
|
|
|
|
small {
|
|
font-size: $fontSizeBase * 0.75;
|
|
opacity: 0.5;
|
|
}
|
|
</style>
|
|
|
|
<li>
|
|
<article>
|
|
<a href={`/blog/${post.slug}`} lang={post.data.lang}>{post.data.title}</a>
|
|
<div>
|
|
<small>
|
|
<time datetime={datePublished} lang="en">{formattedDate}</time>
|
|
<span>•</span>
|
|
<span>{remarkPluginFrontmatter.minutesRead}</span>
|
|
</small>
|
|
</div>
|
|
</article>
|
|
</li>
|