mirror of
https://github.com/valentineus/popov.link.git
synced 2025-07-03 08:00:26 +03:00
- Added ogImages integration to generate Open Graph images for blog posts. - Updated configuration to include Open Graph settings and default preview image. - Refactored Head component to utilize new preview property for Open Graph meta tags. - Enhanced blog post schema to include preview image for structured data representation. - Introduced utility functions for creating Open Graph images with dynamic content.
55 lines
1.8 KiB
Plaintext
55 lines
1.8 KiB
Plaintext
---
|
|
import type { WithContext, Thing } from "schema-dts";
|
|
import JsonLd from "./JsonLd.astro";
|
|
|
|
type Props = {
|
|
readonly description: string;
|
|
readonly preview: string;
|
|
readonly schema: WithContext<Thing>;
|
|
readonly title: string;
|
|
};
|
|
|
|
const { description, preview, schema, title } = Astro.props;
|
|
|
|
const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
|
|
const previewUrl = new URL(preview, Astro.site);
|
|
---
|
|
|
|
<head>
|
|
<!-- Meta Tags -->
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
|
|
<meta name="description" content={description} />
|
|
<meta name="robots" content="index, follow" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<link href="/feed.xml" rel="alternate" title="RSS" type="application/atom+xml" />
|
|
<link href="/sitemap-index.xml" rel="sitemap" />
|
|
<link href={canonicalUrl} rel="canonical" />
|
|
|
|
<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" />
|
|
|
|
<!-- 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={previewUrl} />
|
|
<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={previewUrl} />
|
|
|
|
<JsonLd schema={schema} />
|
|
</head>
|