From a81117972d39df35574bbab809bb590abc874761 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Jun 2025 19:25:16 +0000 Subject: feat: implement Open Graph image generation and enhance configuration - 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. --- src/components/Head.astro | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/components/Head.astro') diff --git a/src/components/Head.astro b/src/components/Head.astro index 0026886..3fded95 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -1,16 +1,18 @@ --- import type { WithContext, Thing } from "schema-dts"; import JsonLd from "./JsonLd.astro"; -import OpenGraph from "./OpenGraph.astro"; type Props = { readonly description: string; - readonly title: string; + readonly preview: string; readonly schema: WithContext; + readonly title: string; }; -const canonicalURL = new URL(Astro.url.pathname, Astro.site); -const { description, title, schema } = Astro.props; +const { description, preview, schema, title } = Astro.props; + +const canonicalUrl = new URL(Astro.url.pathname, Astro.site); +const previewUrl = new URL(preview, Astro.site); --- @@ -24,7 +26,7 @@ const { description, title, schema } = Astro.props; - + {title} @@ -35,6 +37,18 @@ const { description, title, schema } = Astro.props; - + + + + + + + + + + + + + -- cgit v1.2.3