1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-10-01 09:00:12 +02:00
pingvin-share/src/components/Meta.tsx

28 lines
674 B
TypeScript
Raw Normal View History

2022-04-28 15:31:37 +02:00
import Head from "next/head";
2022-05-05 11:22:47 +02:00
const Meta = ({
title,
description,
}: {
title: string;
description?: string;
}) => {
2022-04-28 15:31:37 +02:00
return (
<Head>
2022-05-05 11:22:47 +02:00
{/* TODO: Doesn't work because script get only executed on client side */}
2022-04-28 15:31:37 +02:00
<title>{title} - Pingvin Share</title>
2022-05-05 11:22:47 +02:00
<meta name="og:title" content={`${title} - Pingvin Share`} />
<meta
name="og:description"
content={
description ?? "An open-source and selfhosted sharing platform."
}
/>
<meta name="twitter:title" content={`${title} - Pingvin Share`} />
<meta name="twitter:description" content={description} />
2022-04-28 15:31:37 +02:00
</Head>
);
};
export default Meta;