mirror of
https://github.com/valentineus/popov.link.git
synced 2025-07-04 00:20:26 +03:00
feat: integrate schema.org support and enhance component structure
- Added schema.org support by introducing `schema-dts` for structured data in components. - Updated `Head`, `BaseLayout`, and various page components to accept and utilize schema props for better SEO. - Created new utility schemas for blog posts and website to standardize structured data implementation. - Enhanced the `SocialLinks` section by utilizing dedicated icon components for improved maintainability. - Refactored the `Header` component to improve accessibility and structure. - Introduced new icons for social links and integrated them into the layout.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
---
|
||||
import { getCollection } from "astro:content";
|
||||
import dayjs from "dayjs";
|
||||
import RSSIcon from "../Icons/RSS.astro";
|
||||
|
||||
const posts = await getCollection("blog", ({ data }) => {
|
||||
return data.draft !== true;
|
||||
@ -21,7 +22,7 @@ const latestPosts = posts.slice(0, 5);
|
||||
</style>
|
||||
|
||||
<section>
|
||||
<h2>Latest posts</h2>
|
||||
<h2>Latest posts <RSSIcon /></h2>
|
||||
<ul>
|
||||
{
|
||||
latestPosts.map((post) => (
|
||||
@ -29,7 +30,12 @@ const latestPosts = posts.slice(0, 5);
|
||||
<a href={`/blog/${post.slug}`} lang={post.data.lang}>
|
||||
{post.data.title}
|
||||
</a>
|
||||
<small>{dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY")}</small>
|
||||
|
||||
<small>
|
||||
<time datetime={post.data.pubDate.toISOString()} lang="en">
|
||||
{dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY")}
|
||||
</time>
|
||||
</small>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
|
Reference in New Issue
Block a user