changed the way of embeds

This commit is contained in:
ZareMate 2025-04-15 08:33:03 +02:00
parent 7133c544e1
commit f4368300af
Signed by: zaremate
GPG Key ID: 369A0E45E03A81C3

View File

@ -134,15 +134,24 @@ function UploadsPage() {
);
}
//set page title and description
const pageTitle = `File Details - ${fileDetails.name}`;
const pageDescription = `Details of the file: ${fileDetails.name}`;
useEffect(() => {
document.title = pageTitle;
const metaDescription = document.querySelector('meta[name="description"]');
if (metaDescription) {
metaDescription.setAttribute("content", pageDescription);
}
const metaTitle = document.querySelector('meta[name="title"]');
if (metaTitle) {
metaTitle.setAttribute("content", pageTitle);
}
}, [pageTitle]);
return (
<main className="relative flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c] text-white">
<meta property="og:title" content={fileDetails.name} />
<meta property="og:description" content={`File details for ${fileDetails.name}`} />
<meta property="og:image" content={fileDetails.url} />
<meta property="og:url" content={`${window.location.origin}/share?id=${fileDetails.id}`} />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="File Hosting - Suchodupin" />
<meta property="og:locale" content="en_US" />
<Toaster position="top-right" reverseOrder={false} />
<div className="absolute top-4 left-4">
<button