mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-26 12:47:00 -05:00
feat: Implement dynamic OG images
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user