2022-04-28 15:31:37 +02:00
|
|
|
import Head from "next/head";
|
2023-03-04 23:29:00 +01:00
|
|
|
import useConfig from "../hooks/config.hook";
|
2022-04-28 15:31:37 +02:00
|
|
|
|
2022-05-05 11:22:47 +02:00
|
|
|
const Meta = ({
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
}: {
|
|
|
|
title: string;
|
|
|
|
description?: string;
|
|
|
|
}) => {
|
2023-03-04 23:29:00 +01:00
|
|
|
const config = useConfig();
|
|
|
|
|
|
|
|
const metaTitle = `${title} - ${config.get("general.appName")}`;
|
2023-02-07 10:21:25 +01:00
|
|
|
|
2022-04-28 15:31:37 +02:00
|
|
|
return (
|
|
|
|
<Head>
|
2023-02-07 10:21:25 +01:00
|
|
|
<title>{metaTitle}</title>
|
|
|
|
<meta name="og:title" content={metaTitle} />
|
2022-05-05 11:22:47 +02:00
|
|
|
<meta
|
|
|
|
name="og:description"
|
|
|
|
content={
|
2022-05-12 16:13:16 +02:00
|
|
|
description ?? "An open-source and self-hosted sharing platform."
|
2022-05-05 11:22:47 +02:00
|
|
|
}
|
|
|
|
/>
|
2023-02-07 10:21:25 +01:00
|
|
|
<meta name="twitter:title" content={metaTitle} />
|
2022-05-05 11:22:47 +02:00
|
|
|
<meta name="twitter:description" content={description} />
|
2022-04-28 15:31:37 +02:00
|
|
|
</Head>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Meta;
|