add meta tags

This commit is contained in:
2025-04-09 14:28:41 +04:00
parent 7ad5582c88
commit 9eeba1e0b4
+18
View File
@@ -105,6 +105,24 @@ if (empty($videoData) || isset($videoData['error'])) {
<link rel="stylesheet" href="css/styles.css"> <link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/video-page.css"> <link rel="stylesheet" href="css/video-page.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<!-- Meta tags pour le partage sur les réseaux sociaux -->
<meta property="og:title" content="<?php echo !empty($video['title']) ? htmlspecialchars($video['title']) : 'Vidéo'; ?> - Kaubuntu.re">
<meta property="og:description" content="<?php echo !empty($video['description']) ? htmlspecialchars(substr(strip_tags($video['description']), 0, 200)) . '...' : 'Regardez cette vidéo sur Kaubuntu.re'; ?>">
<?php if (isset($videoData['thumbnailPath'])): ?>
<meta property="og:image" content="<?php echo PEERTUBE_URL . $videoData['thumbnailPath']; ?>">
<?php endif; ?>
<meta property="og:url" content="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>">
<meta property="og:type" content="video.other">
<meta property="og:site_name" content="Kaubuntu.re">
<!-- Meta tags pour Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php echo !empty($video['title']) ? htmlspecialchars($video['title']) : 'Vidéo'; ?> - Kaubuntu.re">
<meta name="twitter:description" content="<?php echo !empty($video['description']) ? htmlspecialchars(substr(strip_tags($video['description']), 0, 200)) . '...' : 'Regardez cette vidéo sur Kaubuntu.re'; ?>">
<?php if (isset($videoData['thumbnailPath'])): ?>
<meta name="twitter:image" content="<?php echo PEERTUBE_URL . $videoData['thumbnailPath']; ?>">
<?php endif; ?>
</head> </head>
<body> <body>
<!-- Sidebar de navigation --> <!-- Sidebar de navigation -->