Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: deduplicate head tags

Marc Seitz2b8abf33d1a1
diff --git a/components/view/custom-metatag.tsx b/components/view/custom-metatag.tsx
index 3f785a95..bc515705 100644
--- a/components/view/custom-metatag.tsx
+++ b/components/view/custom-metatag.tsx
@@ -12,16 +12,39 @@ const CustomMetatag = ({
return (
<Head>
{title ? <title>{title}</title> : null}
- {title ? <meta property="og:title" content={title} /> : null}
{description ? (
- <meta name="og:description" content={description} />
+ <meta
+ property="og:description"
+ content={description}
+ key="description"
+ />
+ ) : null}
+ {title ? (
+ <meta property="og:title" content={title} key="og-title" />
+ ) : null}
+ {description ? (
+ <meta
+ name="og:description"
+ content={description}
+ key="og-description"
+ />
+ ) : null}
+ {imageUrl ? (
+ <meta name="og:image" content={imageUrl} key="og-image" />
+ ) : null}
+ {title ? (
+ <meta name="twitter:title" content={title} key="tw-title" />
) : null}
- {imageUrl ? <meta name="og:image" content={imageUrl} /> : null}
- {title ? <meta name="twitter:title" content={title} /> : null}
{description ? (
- <meta name="twitter:description" content={description} />
+ <meta
+ name="twitter:description"
+ content={description}
+ key="tw-description"
+ />
+ ) : null}
+ {imageUrl ? (
+ <meta name="twitter:image" content={imageUrl} key="tw-image" />
) : null}
- {imageUrl ? <meta name="twitter:image" content={imageUrl} /> : null}
</Head>
);
};
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 9d8f98a7..7a8d2b44 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -20,6 +20,43 @@ export default function App({
<>
<Head>
<title>Papermark | The Open Source DocSend Alternative</title>
+ <meta name="theme-color" content="#000000" />
+ <meta
+ name="description"
+ content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
+ key="description"
+ />
+ <meta
+ property="og:title"
+ content="Papermark | The Open Source DocSend Alternative"
+ key="og-title"
+ />
+ <meta
+ property="og:description"
+ content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
+ key="og-description"
+ />
+ <meta
+ property="og:image"
+ content="https://www.papermark.io/_static/meta-image.png"
+ key="og-image"
+ />
+ <meta property="og:url" content="https://www.papermark.io" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:site" content="@papermarkio" />
+ <meta name="twitter:creator" content="@papermarkio" />
+ <meta name="twitter:title" content="Papermark" key="tw-title" />
+ <meta
+ name="twitter:description"
+ content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
+ key="tw-description"
+ />
+ <meta
+ name="twitter:image"
+ content="https://www.papermark.io/_static/meta-image.png"
+ key="tw-image"
+ />
+ <link rel="icon" href="/favicon.ico" />
</Head>
<SessionProvider session={session}>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
diff --git a/pages/_document.tsx b/pages/_document.tsx
index a0945840..9abc64dc 100644
--- a/pages/_document.tsx
+++ b/pages/_document.tsx
@@ -3,39 +3,7 @@ import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (
<Html lang="en" className="h-full bg-background" suppressHydrationWarning>
- <Head>
- <meta name="theme-color" content="#000000" />
- <meta
- name="description"
- content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
- />
- <meta
- property="og:title"
- content="Papermark | The Open Source DocSend Alternative"
- />
- <meta
- property="og:description"
- content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
- />
- <meta
- property="og:image"
- content="https://www.papermark.io/_static/meta-image.png"
- />
- <meta property="og:url" content="https://www.papermark.io" />
- <meta name="twitter:card" content="summary_large_image" />
- <meta name="twitter:site" content="@papermarkio" />
- <meta name="twitter:creator" content="@papermarkio" />
- <meta name="twitter:title" content="Papermark" />
- <meta
- name="twitter:description"
- content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
- />
- <meta
- name="twitter:image"
- content="https://www.papermark.io/_static/meta-image.png"
- />
- <link rel="icon" href="/favicon.ico" />
- </Head>
+ <Head />
<body className="h-full">
<Main />
<NextScript />