0
mirror of https://github.com/valentineus/popov.link.git synced 2025-07-19 22:58:48 +03:00

Compare commits

...

8 Commits

Author SHA1 Message Date
3d0f485746 feat: add Open Graph and JSON-LD support to Head component
- Introduced OpenGraph component for enhanced social media sharing with Open Graph meta tags.
- Updated Head component to include OpenGraph and JSON-LD for improved SEO and structured data representation.
- Added comments for better clarity on meta tags and JSON-LD integration.
2025-06-14 12:19:01 +00:00
25ebd94466 refactor: remove preview property from blog post schema and configuration
- Eliminated the optional `preview` field from the blog post schema and configuration to streamline data handling.
- Updated the blog post schema to utilize the default image directly from configuration, enhancing consistency in image representation.
2025-06-14 12:12:16 +00:00
0473060773 feat: add configuration and default image for blog posts
- Introduced a new configuration file to centralize author information and default image settings for blog posts.
- Added a default image path in the blog post configuration for improved content presentation.
- Updated blog post schema to utilize the new configuration for author details, enhancing structured data representation.
2025-06-14 12:08:48 +00:00
a65e9c8455 feat: enhance blog post and page schema with new properties
- Added optional `basedOn` field to blog post schema for better content attribution.
- Updated blog post markdown to include `basedOn` reference for improved context.
- Refactored page schema to replace deprecated website schema, enhancing structured data representation.
- Adjusted 404 and index pages to utilize the new page schema for consistency and SEO improvements.
2025-06-14 11:47:17 +00:00
17f9a467d7 refactor: update blog post date handling and schema
- 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.
2025-06-14 11:25:17 +00:00
3df02c5304 feat: enhance blog post schema and structure
- Added description and lang parameters to the blogPostSchema for improved structured data.
- Updated the blog post layout to include a header section for better semantic structure and accessibility.
2025-06-14 11:09:34 +00:00
9777d996d1 refactor: enhance PostElement structure and update blog schema
- Wrapped the post link in an <article> tag for improved semantic structure.
- Updated blogSchema to include posts for better structured data representation.
- Adjusted the blog index to utilize the new posts parameter for enhanced SEO.
2025-06-14 11:01:42 +00:00
1c15151ef5 fix: enhance accessibility by adding role attribute to SVG icons 2025-06-14 10:53:20 +00:00
26 changed files with 166 additions and 72 deletions

BIN
public/images/photo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

View File

@@ -1,6 +1,7 @@
---
import type { WithContext, Thing } from "schema-dts";
import JsonLd from "./JsonLd.astro";
import OpenGraph from "./OpenGraph.astro";
type Props = {
readonly description: string;
@@ -13,6 +14,7 @@ const { description, title, schema } = Astro.props;
---
<head>
<!-- Meta Tags -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
@@ -26,11 +28,13 @@ const { description, title, schema } = Astro.props;
<title>{title}</title>
<!-- Icons -->
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#ffffff" />
<OpenGraph title={title} description={description} />
<JsonLd schema={schema} />
</head>

View File

@@ -13,7 +13,7 @@
</style>
<a href="mailto:valentin@popov.link" title="E-Mail" target="_blank">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="E-Mail">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="E-Mail" aria-hidden="true">
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
<polyline points="22,6 12,13 2,6"></polyline>
</svg>

View File

@@ -13,7 +13,7 @@
</style>
<a href="https://github.com/valentineus" title="GitHub" target="_blank">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="GitHub">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="GitHub" aria-hidden="true">
<path
d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"
>

View File

@@ -13,7 +13,7 @@
</style>
<a href="https://www.linkedin.com/in/valentineus/" title="LinkedIn" target="_blank">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="LinkedIn">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="LinkedIn" aria-hidden="true">
<path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path>
<rect x="2" y="9" width="4" height="12"></rect>
<circle cx="4" cy="4" r="2"></circle>

View File

@@ -9,7 +9,7 @@
</style>
<a href="/feed.xml" title="RSS Feed" target="_blank">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="RSS Feed">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="RSS Feed" aria-hidden="true">
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>

View File

@@ -9,4 +9,5 @@ const { schema } = Astro.props;
const json = JSON.stringify(schema);
---
<!-- JSON-LD -->
<script is:inline type="application/ld+json" set:html={json} />

View File

@@ -0,0 +1,26 @@
---
import { config } from "../config";
type Props = {
readonly description: string;
readonly title: string;
};
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const { description, title } = Astro.props;
const image = new URL(config.posts.defaultImage, Astro.site).toString();
---
<!-- Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={image} />
<meta property="og:url" content={canonicalURL} />
<!-- Twitter Cards -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={image} />

View File

@@ -8,7 +8,9 @@ type Props = {
const { post } = Astro.props;
const { remarkPluginFrontmatter } = await post.render();
const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY");
const formattedDate = dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY");
const datePublished = post.data.datePublished.toISOString();
---
<style lang="scss">
@@ -25,12 +27,14 @@ const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"
</style>
<li>
<a href={`/blog/${post.slug}`} lang={post.data.lang}>{post.data.title}</a>
<div>
<small>
<time datetime={post.data.pubDate.toISOString()} lang="en">{formattedDate}</time>
<span>•</span>
<span>{remarkPluginFrontmatter.minutesRead}</span>
</small>
</div>
<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>

View File

@@ -7,7 +7,7 @@ const posts = await getCollection("blog", ({ data }) => {
return data.draft !== true;
});
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
posts.sort((a, b) => b.data.datePublished.getTime() - a.data.datePublished.getTime());
const latestPosts = posts.slice(0, 5);
---
@@ -32,8 +32,8 @@ const latestPosts = posts.slice(0, 5);
</a>
<small>
<time datetime={post.data.pubDate.toISOString()} lang="en">
{dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY")}
<time datetime={post.data.datePublished.toISOString()} lang="en">
{dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY")}
</time>
</small>
</li>

10
src/config.ts Normal file
View File

@@ -0,0 +1,10 @@
export const config = {
author: {
name: "Valentin Popov",
url: "https://popov.link/",
sameAs: ["https://www.linkedin.com/in/valentineus/", "https://github.com/valentineus"],
},
posts: {
defaultImage: "/images/photo.png",
},
};

View File

@@ -1,8 +1,9 @@
---
basedOn: "https://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/"
title: 'Create ".lib" file from ".dll" (archive)'
author: "Adrian Henke"
pubDate: "2023-05-04"
description: "Learn how to generate a *.lib file from a *.dll with this comprehensive guide. Using the Visual Studio Command Prompt and Microsoft's recommended tools, this article walks you through the steps for a seamless process. Perfect for developers working with 3rd party win dll's."
datePublished: "2023-05-04"
dateModified: "2023-05-04"
lang: "en"
---

View File

@@ -1,8 +1,8 @@
---
title: "Горячая перезагрузка ElectronJS приложения"
author: "Valentin Popov"
pubDate: "2019-08-15"
description: "Руководство по автоматической перезагрузке приложений на Electron с помощью пакетов electron-reload и electron-webpack. Обход проблем с совместимостью и использование HMR для renderer процесса."
datePublished: "2019-08-15"
dateModified: "2019-08-15"
lang: "ru"
---

View File

@@ -1,8 +1,8 @@
---
title: "Example Content"
author: "Example User"
pubDate: "2018-01-01"
description: "Howdy! This is an example blog post that shows several types of HTML content supported in this theme."
datePublished: "2018-01-01"
dateModified: "2018-01-01"
lang: "en"
draft: true
---

View File

@@ -1,8 +1,8 @@
---
title: 'Получение исходного кода "Chromium Projects"'
author: "Valentin Popov"
pubDate: "2012-01-30"
description: "Изучение исходных кодов Chromium: подготовка системы и установка необходимых программных компонентов. Руководство для начинающих разработчиков. Получите инструкции по установке Microsoft Visual Studio, Cygwin, Python и других инструментов. Действительно на январь-февраль 2012 года."
datePublished: "2012-01-30"
dateModified: "2012-01-30"
lang: "ru"
---

View File

@@ -1,8 +1,8 @@
---
title: "Установка Moodle в Fedora"
author: "Valentin Popov"
pubDate: "2018-07-23"
description: "Решение проблем установки Moodle из-за SELinux: как настроить правила доступа для устранения ошибок в веб-интерфейсе и при работе с cURL. Практические советы и команды."
datePublished: "2018-07-23"
dateModified: "2018-07-23"
lang: "ru"
---

View File

@@ -1,8 +1,8 @@
---
title: "Компиляция Rust на TL-MR3020"
author: "Valentin Popov"
pubDate: "2023-05-01"
description: 'Как настроить и оптимизировать проект Rust для кросс-компиляции на TP-Link TL-MR3020 с использованием Fedora Linux 38 и OpenWrt 22.03.4. Шаг за шагом от базового "Hello, World!" до асинхронного TCP сервера.'
datePublished: "2023-05-01"
dateModified: "2023-05-01"
lang: "ru"
---

View File

@@ -3,12 +3,13 @@ import { defineCollection, z } from "astro:content";
const blog = defineCollection({
type: "content",
schema: z.object({
author: z.string(),
basedOn: z.optional(z.string()),
dateModified: z.coerce.date(),
datePublished: z.coerce.date(),
description: z.string(),
draft: z.optional(z.boolean()),
pubDate: z.coerce.date(),
title: z.string(),
lang: z.string(),
title: z.string(),
}),
});

View File

@@ -1,14 +1,17 @@
---
import Layout from "../layouts/BaseLayout.astro";
import websiteSchema from "../utils/schemas/websiteSchema";
import pageSchema from "../utils/schemas/pageSchema";
const title = "404 — Page Not Found | Valentin Popov";
const description = "The page you're looking for doesn't exist!";
const lang = "en";
const schema = websiteSchema({
const schema = pageSchema({
siteUrl: new URL("/", Astro.site).toString(),
page: "/404",
title,
description,
lang,
});
---

View File

@@ -22,20 +22,25 @@ const post = Astro.props;
const { Content, remarkPluginFrontmatter } = await post.render();
const title = post.data.title;
const description = post.data.description;
const author = post.data.author;
const isBasedOn = post.data.basedOn;
const lang = post.data.lang;
const slug = post.slug;
const title = post.data.title;
const formattedData = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY");
const data = post.data.pubDate.toISOString();
const dateModified = post.data.dateModified?.toISOString();
const datePublished = post.data.datePublished.toISOString();
const formattedDate = dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY");
const schema = blogPostSchema({
siteUrl: new URL("/", Astro.site).toString(),
title,
slug: post.slug,
datePublished: data,
author,
description,
slug,
datePublished,
dateModified,
lang,
isBasedOn,
});
---
@@ -49,21 +54,18 @@ const schema = blogPostSchema({
<Layout title={title} description={description} lang={lang} schema={schema}>
<article>
<section>
<header>
<h1>{title}</h1>
</section>
<section>
<p>
<small>
Posted
<time datetime={data} lang="en">{formattedData}</time>
by&nbsp;{author}
<time datetime={datePublished} lang="en">{formattedDate}</time>
<span>&nbsp;•&nbsp;</span>
<span>{remarkPluginFrontmatter.minutesRead}</span>
</small>
</p>
</section>
</header>
<section>
<Content />

View File

@@ -10,10 +10,10 @@ const posts = await getCollection("blog", ({ data }) => {
return data.draft !== true;
});
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
posts.sort((a, b) => b.data.datePublished.getTime() - a.data.datePublished.getTime());
const postsByYear = posts.reduce<Record<string, CollectionEntry<"blog">[]>>((acc, post) => {
const year = post.data.pubDate.getFullYear().toString();
const year = post.data.datePublished.getFullYear().toString();
if (!acc[year]) {
acc[year] = [];
}
@@ -30,6 +30,7 @@ const lang = "en";
const schema = blogSchema({
siteUrl: new URL("/", Astro.site).toString(),
title,
posts,
});
---

View File

@@ -3,15 +3,18 @@ import Layout from "../layouts/BaseLayout.astro";
import LatestPostsSection from "../components/Sections/LatestPosts.astro";
import SocialLinksSection from "../components/Sections/SocialLinks.astro";
import WelcomeSection from "../components/Sections/Welcome.astro";
import websiteSchema from "../utils/schemas/websiteSchema";
import pageSchema from "../utils/schemas/pageSchema";
const title = "Valentin Popov Software Developer & Team Lead | Tech Insights";
const description = "Blog by Valentin Popov — software developer and team lead writing about code, side projects, digital tools, and fun experiments.";
const lang = "en";
const schema = websiteSchema({
const schema = pageSchema({
siteUrl: new URL("/", Astro.site).toString(),
page: "/",
title,
description,
lang,
});
---

View File

@@ -1,21 +1,36 @@
import type { WithContext, BlogPosting } from "schema-dts";
import { config } from "../../config";
export type BlogPostSchemaParams = {
readonly siteUrl: string;
readonly title: string;
readonly slug: string;
readonly dateModified: string;
readonly datePublished: string;
readonly author: string;
readonly description: string;
readonly isBasedOn?: string;
readonly lang: string;
readonly siteUrl: string;
readonly slug: string;
readonly title: string;
};
export default ({ siteUrl, title, slug, datePublished, author }: BlogPostSchemaParams): WithContext<BlogPosting> => ({
export default ({ siteUrl, slug, title, description, datePublished, dateModified, lang, isBasedOn }: BlogPostSchemaParams): WithContext<BlogPosting> => ({
"@context": "https://schema.org",
"@type": "BlogPosting",
"url": new URL(`/blog/${slug}`, siteUrl).toString(),
"headline": title,
"description": description,
"image": new URL(config.posts.defaultImage, siteUrl).toString(),
"datePublished": datePublished,
"dateModified": dateModified,
"inLanguage": lang,
"author": {
"@type": "Person",
"name": author,
"name": config.author.name,
"url": config.author.url,
"sameAs": config.author.sameAs,
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": new URL(`/blog/${slug}`, siteUrl).toString(),
},
...(isBasedOn && { isBasedOn: isBasedOn }),
});

View File

@@ -1,13 +1,26 @@
import type { WithContext, Blog } from "schema-dts";
import type { WithContext, CollectionPage } from "schema-dts";
import type { CollectionEntry } from "astro:content";
export type BlogSchemaParams = {
readonly posts: CollectionEntry<"blog">[];
readonly siteUrl: string;
readonly title: string;
};
export default ({ siteUrl, title }: BlogSchemaParams): WithContext<Blog> => ({
export default ({ siteUrl, title, posts }: BlogSchemaParams): WithContext<CollectionPage> => ({
"@context": "https://schema.org",
"@type": "Blog",
"@type": "CollectionPage",
"url": new URL("/blog/", siteUrl).toString(),
"name": title,
"mainEntity": {
"@type": "ItemList",
"itemListOrder": "https://schema.org/ItemListOrderDescending",
"numberOfItems": posts.length,
"itemListElement": posts.map((post, index) => ({
"@type": "ListItem",
"position": index + 1,
"url": new URL(`/blog/${post.slug}`, siteUrl).toString(),
"name": post.data.title,
})),
},
});

View File

@@ -0,0 +1,23 @@
import type { WithContext, WebPage } from "schema-dts";
export type WebsiteSchemaParams = {
readonly description: string;
readonly page: string;
readonly siteUrl: string;
readonly title: string;
readonly lang: string;
};
export default ({ siteUrl, page, title, description, lang }: WebsiteSchemaParams): WithContext<WebPage> => ({
"@context": "https://schema.org",
"@type": "WebPage",
"@id": new URL(page, siteUrl).toString(),
"url": new URL(page, siteUrl).toString(),
"name": title,
"description": description,
"inLanguage": lang,
"mainEntity": {
"@type": "WebSite",
"@id": new URL("/", siteUrl).toString(),
},
});

View File

@@ -1,13 +0,0 @@
import type { WithContext, WebSite } from "schema-dts";
export type WebsiteSchemaParams = {
readonly siteUrl: string;
readonly title: string;
};
export default ({ siteUrl, title }: WebsiteSchemaParams): WithContext<WebSite> => ({
"@context": "https://schema.org",
"@type": "WebSite",
"url": new URL("/", siteUrl).toString(),
"name": title,
});