2024-09-05 15:01:13 +00:00
|
|
|
---
|
2026-04-22 16:11:58 +00:00
|
|
|
import type { Thing } from "schema-dts";
|
2026-04-22 17:53:21 +00:00
|
|
|
import { config } from "../config";
|
2025-06-11 23:20:36 +00:00
|
|
|
import JsonLd from "./JsonLd.astro";
|
|
|
|
|
|
2024-09-12 16:36:57 +00:00
|
|
|
type Props = {
|
2024-09-12 22:57:55 +00:00
|
|
|
readonly description: string;
|
2026-04-22 17:53:21 +00:00
|
|
|
readonly lang: string;
|
|
|
|
|
readonly modifiedTime?: string;
|
|
|
|
|
readonly ogType?: "website" | "article";
|
2025-06-14 19:25:16 +00:00
|
|
|
readonly preview: string;
|
2026-04-22 17:53:21 +00:00
|
|
|
readonly publishedTime?: string;
|
2026-04-22 16:11:58 +00:00
|
|
|
readonly robots?: string;
|
|
|
|
|
readonly schema: Thing[];
|
2025-06-14 19:25:16 +00:00
|
|
|
readonly title: string;
|
2024-09-12 16:36:57 +00:00
|
|
|
};
|
2024-09-11 22:03:55 +00:00
|
|
|
|
2026-04-22 17:53:21 +00:00
|
|
|
const { description, lang, modifiedTime, ogType = "website", preview, publishedTime, robots = "index, follow", schema, title } = Astro.props;
|
2025-06-14 19:25:16 +00:00
|
|
|
|
|
|
|
|
const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
|
|
|
|
|
const previewUrl = new URL(preview, Astro.site);
|
2026-04-22 17:53:21 +00:00
|
|
|
const ogLocale = lang === "ru" ? "ru_RU" : "en_US";
|
2024-09-05 15:01:13 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
|
|
<head>
|
2025-06-14 12:19:01 +00:00
|
|
|
<!-- Meta Tags -->
|
2026-04-22 17:53:21 +00:00
|
|
|
<meta charset="utf-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
2024-09-11 22:03:55 +00:00
|
|
|
|
2024-09-12 22:57:55 +00:00
|
|
|
<meta name="description" content={description} />
|
2026-04-22 16:11:58 +00:00
|
|
|
<meta name="robots" content={robots} />
|
2026-04-22 17:53:21 +00:00
|
|
|
<meta name="author" content={config.author.name} />
|
2024-09-05 15:01:13 +00:00
|
|
|
|
|
|
|
|
<link href="/feed.xml" rel="alternate" title="RSS" type="application/atom+xml" />
|
|
|
|
|
<link href="/sitemap-index.xml" rel="sitemap" />
|
2025-06-14 19:25:16 +00:00
|
|
|
<link href={canonicalUrl} rel="canonical" />
|
2026-04-22 17:53:21 +00:00
|
|
|
<link href={config.author.url} rel="author" />
|
|
|
|
|
|
|
|
|
|
<!-- hreflang -->
|
|
|
|
|
<link rel="alternate" hreflang={lang} href={canonicalUrl} />
|
|
|
|
|
<link rel="alternate" hreflang="x-default" href={canonicalUrl} />
|
2024-09-05 15:01:13 +00:00
|
|
|
|
2024-09-12 22:57:55 +00:00
|
|
|
<title>{title}</title>
|
2025-02-05 00:20:40 +00:00
|
|
|
|
2025-06-14 12:19:01 +00:00
|
|
|
<!-- Icons -->
|
2025-06-05 23:33:09 +00:00
|
|
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
|
|
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
2025-02-05 00:20:40 +00:00
|
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
|
|
|
<link rel="manifest" href="/manifest.json" />
|
2026-04-22 17:53:21 +00:00
|
|
|
<meta name="theme-color" content="#181818" />
|
2025-06-11 23:20:36 +00:00
|
|
|
|
2025-06-14 19:25:16 +00:00
|
|
|
<!-- Open Graph -->
|
2026-04-22 17:53:21 +00:00
|
|
|
<meta property="og:type" content={ogType} />
|
|
|
|
|
<meta property="og:site_name" content={config.og.website} />
|
|
|
|
|
<meta property="og:locale" content={ogLocale} />
|
2025-06-14 19:25:16 +00:00
|
|
|
<meta property="og:title" content={title} />
|
|
|
|
|
<meta property="og:description" content={description} />
|
|
|
|
|
<meta property="og:url" content={canonicalUrl} />
|
2026-04-22 17:53:21 +00:00
|
|
|
<meta property="og:image" content={previewUrl} />
|
|
|
|
|
<meta property="og:image:width" content={String(config.og.dimensions.width)} />
|
|
|
|
|
<meta property="og:image:height" content={String(config.og.dimensions.height)} />
|
|
|
|
|
<meta property="og:image:alt" content={title} />
|
|
|
|
|
|
|
|
|
|
{ogType === "article" && publishedTime && <meta property="article:published_time" content={publishedTime} />}
|
|
|
|
|
{ogType === "article" && modifiedTime && <meta property="article:modified_time" content={modifiedTime} />}
|
|
|
|
|
{ogType === "article" && <meta property="article:author" content={config.author.url} />}
|
2025-06-14 19:25:16 +00:00
|
|
|
|
|
|
|
|
<!-- Twitter Cards -->
|
|
|
|
|
<meta name="twitter:card" content="summary_large_image" />
|
2026-04-22 17:53:21 +00:00
|
|
|
<meta name="twitter:site" content="@valyaha" />
|
|
|
|
|
<meta name="twitter:creator" content="@valyaha" />
|
2025-06-14 19:25:16 +00:00
|
|
|
<meta name="twitter:title" content={title} />
|
|
|
|
|
<meta name="twitter:description" content={description} />
|
|
|
|
|
<meta name="twitter:image" content={previewUrl} />
|
2026-04-22 17:53:21 +00:00
|
|
|
<meta name="twitter:image:alt" content={title} />
|
2025-06-14 19:25:16 +00:00
|
|
|
|
2025-06-11 23:20:36 +00:00
|
|
|
<JsonLd schema={schema} />
|
2024-09-05 15:01:13 +00:00
|
|
|
</head>
|