feat: Implement dynamic OG images

This commit is contained in:
gpt-engineer-app[bot]
2025-10-29 16:49:41 +00:00
parent 320df82329
commit ac63e1d2db
9 changed files with 166 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import { Skeleton } from '@/components/ui/skeleton';
import { Header } from '@/components/layout/Header';
import { Footer } from '@/components/layout/Footer';
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
import { useOpenGraph } from '@/hooks/useOpenGraph';
export default function BlogPost() {
const { slug } = useParams<{ slug: string }>();
@@ -35,6 +36,16 @@ export default function BlogPost() {
// Update document title when post changes
useDocumentTitle(post?.title || 'Blog Post');
// Update Open Graph meta tags
useOpenGraph({
title: post?.title || '',
description: post?.content?.substring(0, 160),
imageUrl: post?.featured_image_url,
imageId: post?.featured_image_id,
type: 'article',
enabled: !!post
});
useEffect(() => {
if (slug) {