mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-21 06:03:13 +02:00
Add Open Graph tags
This commit is contained in:
@@ -1,9 +1,25 @@
|
||||
import Head from "next/head";
|
||||
|
||||
const Meta = ({ title }: { title: string }) => {
|
||||
const Meta = ({
|
||||
title,
|
||||
description,
|
||||
}: {
|
||||
title: string;
|
||||
description?: string;
|
||||
}) => {
|
||||
return (
|
||||
<Head>
|
||||
{/* TODO: Doesn't work because script get only executed on client side */}
|
||||
<title>{title} - Pingvin Share</title>
|
||||
<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} />
|
||||
</Head>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -11,8 +11,13 @@ export default class _Document extends Document {
|
||||
<Html>
|
||||
<Head>
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="theme-color" content="#46509e" />
|
||||
<link rel="apple-touch-icon" href="/icons/icon-white-128x128.png" />
|
||||
|
||||
<meta property="og:image" content="/img/opengraph-default.png" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:image" content="/img/opengraph-default.png" />
|
||||
<meta name="robots" content="noindex" />
|
||||
<meta name="theme-color" content="#46509e" />
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
|
||||
Reference in New Issue
Block a user