Improve social media image and URL generation for better sharing
Update social media image URL to use cache-busting with current timestamp and prioritize Bunny.net thumbnail. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/HCAS0JG
This commit is contained in:
parent
169b4b777b
commit
49fbc393a6
@ -119,7 +119,7 @@
|
|||||||
<script>
|
<script>
|
||||||
// Set dynamic URLs based on current domain
|
// Set dynamic URLs based on current domain
|
||||||
const currentOrigin = window.location.origin;
|
const currentOrigin = window.location.origin;
|
||||||
const socialImageUrl = `${currentOrigin}/api/social-image?v=2025`;
|
const socialImageUrl = `${currentOrigin}/api/social-image?v=${Date.now()}`;
|
||||||
|
|
||||||
// Update meta tags with correct URLs
|
// Update meta tags with correct URLs
|
||||||
document.getElementById('og-url').setAttribute('content', currentOrigin + '/');
|
document.getElementById('og-url').setAttribute('content', currentOrigin + '/');
|
||||||
|
|||||||
@ -180,10 +180,14 @@ export default function VideoPage() {
|
|||||||
: `${currentVideo.title} - Professionelle Video-Streaming-Plattform mit exklusivem Content von FOLX STADL, Geschichte des Liedes und weiteren Premium-Inhalten auf go4.video.`;
|
: `${currentVideo.title} - Professionelle Video-Streaming-Plattform mit exklusivem Content von FOLX STADL, Geschichte des Liedes und weiteren Premium-Inhalten auf go4.video.`;
|
||||||
|
|
||||||
updateMetaTag('og:description', richDescription);
|
updateMetaTag('og:description', richDescription);
|
||||||
// Get the correct domain dynamically and add cache-busting
|
// For social media, use direct Bunny.net thumbnail if available, otherwise fallback to our endpoint
|
||||||
const timestamp = new Date().getTime();
|
const timestamp = new Date().getTime();
|
||||||
const currentDomain = window.location.origin;
|
const currentDomain = window.location.origin;
|
||||||
const socialThumbnail = `${currentDomain}/api/video-thumbnail/${currentVideo.id}?v=${timestamp}`;
|
|
||||||
|
// Use original Bunny thumbnail with cache-busting for social media
|
||||||
|
const socialThumbnail = currentVideo.thumbnailUrl
|
||||||
|
? `${currentVideo.thumbnailUrl}?t=${timestamp}`
|
||||||
|
: `${currentDomain}/api/video-thumbnail/${currentVideo.id}?v=${timestamp}`;
|
||||||
updateMetaTag('og:image', socialThumbnail);
|
updateMetaTag('og:image', socialThumbnail);
|
||||||
updateMetaTag('og:image:width', '1200');
|
updateMetaTag('og:image:width', '1200');
|
||||||
updateMetaTag('og:image:height', '630');
|
updateMetaTag('og:image:height', '630');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user