Skip to content

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

refactor: cleanup custom meta conditionals

Marc Seitz99b4148c4b96
diff --git a/components/view/custom-metatag.tsx b/components/view/custom-metatag.tsx
index 9d82169c..67470f2b 100644
--- a/components/view/custom-metatag.tsx
+++ b/components/view/custom-metatag.tsx
@@ -15,57 +15,62 @@ const CustomMetatag = ({
}) => {
return (
<Head>
- {
- url && (
- <>
- <link rel="canonical" href={url} key="canonical" />
- <meta property="og:url" content={url} key="og-url" />
- </>
- )
- }
- {title && <>
- <title>{title}</title>
- <meta property="og:title" content={title} key="og-title" />
- <meta name="twitter:title" content={title} key="tw-title" />
- </>}
- {
- !enableBranding && (
- <>
- <meta property="og:image" content={`/api/og?title=${title ?? ''}`} key="og-image" />
- <meta name="twitter:image" content={`/api/og?title=${title ?? ''}`} key="tw-image" />
- </>
- )
- }
- {
- enableBranding && (
- <>
- {description ? (
- <meta name="description" content={description} key="description" />
- ) : null}
- {description ? (
+ {url && (
+ <>
+ <link rel="canonical" href={url} key="canonical" />
+ <meta property="og:url" content={url} key="og-url" />
+ </>
+ )}
+ {title && (
+ <>
+ <title>{title}</title>
+ <meta property="og:title" content={title} key="og-title" />
+ <meta name="twitter:title" content={title} key="tw-title" />
+ </>
+ )}
+ {!enableBranding && (
+ <>
+ <meta
+ property="og:image"
+ content={`/api/og?title=${title ?? ""}`}
+ key="og-image"
+ />
+ <meta
+ name="twitter:image"
+ content={`/api/og?title=${title ?? ""}`}
+ key="tw-image"
+ />
+ </>
+ )}
+ {enableBranding && (
+ <>
+ {description ? (
+ <>
+ <meta
+ name="description"
+ content={description}
+ key="description"
+ />
<meta
property="og:description"
content={description}
key="og-description"
/>
- ) : null}
- {imageUrl ? (
- <meta property="og:image" content={imageUrl} key="og-image" />
- ) : null}
-
- {description ? (
<meta
name="twitter:description"
content={description}
key="tw-description"
/>
- ) : null}
- {imageUrl ? (
+ </>
+ ) : null}
+ {imageUrl ? (
+ <>
+ <meta property="og:image" content={imageUrl} key="og-image" />
<meta name="twitter:image" content={imageUrl} key="tw-image" />
- ) : null}
- </>
- )
- }
+ </>
+ ) : null}
+ </>
+ )}
</Head>
);
};