From 933d6874b1fe1dbb113e9de39425f2d713a72408 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 22 Apr 2026 17:53:21 +0000 Subject: feat: enhance blog and SEO features with new plugins and metadata - Introduced rehypeLazyImages plugin for lazy loading images in blog posts. - Updated sitemap integration to include last modified dates for blog posts. - Enhanced Head and BaseLayout components to support additional Open Graph metadata. - Improved RSS feed generation with sanitized content and author information. - Updated manifest.json for a darker theme and standalone display mode. - Added support for language-specific attributes in various components. - Refactored blog post handling to include modified and published timestamps. --- src/components/Head.astro | 37 +++++++++++++++++++++++++------ src/components/Header.astro | 4 ++-- src/components/PostElement.astro | 2 +- src/components/Sections/LatestPosts.astro | 2 +- 4 files changed, 34 insertions(+), 11 deletions(-) (limited to 'src/components') diff --git a/src/components/Head.astro b/src/components/Head.astro index 258162d..fbfba1c 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -1,33 +1,44 @@ --- import type { Thing } from "schema-dts"; +import { config } from "../config"; import JsonLd from "./JsonLd.astro"; type Props = { readonly description: string; + readonly lang: string; + readonly modifiedTime?: string; + readonly ogType?: "website" | "article"; readonly preview: string; + readonly publishedTime?: string; readonly robots?: string; readonly schema: Thing[]; readonly title: string; }; -const { description, preview, robots = "index, follow", schema, title } = Astro.props; +const { description, lang, modifiedTime, ogType = "website", preview, publishedTime, robots = "index, follow", schema, title } = Astro.props; const canonicalUrl = new URL(Astro.url.pathname, Astro.site); const previewUrl = new URL(preview, Astro.site); +const ogLocale = lang === "ru" ? "ru_RU" : "en_US"; --- - - + + - + + + + + + {title} @@ -36,20 +47,32 @@ const previewUrl = new URL(preview, Astro.site); - + - + + + - + + + + + + {ogType === "article" && publishedTime && } + {ogType === "article" && modifiedTime && } + {ogType === "article" && } + + + diff --git a/src/components/Header.astro b/src/components/Header.astro index f9a0c57..3013520 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -10,7 +10,7 @@
diff --git a/src/components/PostElement.astro b/src/components/PostElement.astro index 051a8ff..e201102 100644 --- a/src/components/PostElement.astro +++ b/src/components/PostElement.astro @@ -31,7 +31,7 @@ const datePublished = post.data.datePublished.toISOString(); {post.data.title}
- + {remarkPluginFrontmatter.minutesRead} diff --git a/src/components/Sections/LatestPosts.astro b/src/components/Sections/LatestPosts.astro index 5c6afd9..daba4c8 100644 --- a/src/components/Sections/LatestPosts.astro +++ b/src/components/Sections/LatestPosts.astro @@ -32,7 +32,7 @@ const latestPosts = posts.slice(0, 5); - -- cgit v1.2.3