developers.urbit.org/components/Meta.js

55 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

2022-12-10 03:00:28 +03:00
export default function Meta(post, disableImage, large = false) {
2022-06-22 23:54:19 +03:00
const author = post?.extra?.author || "Urbit";
const title = post?.title ? `${post.title} - ` : "";
const description =
2022-11-23 02:44:22 +03:00
post?.description || "Urbit provides foundational primitives at the operating system layer, serving as a better platform for building networked, decentralized applications.";
2022-06-22 23:54:19 +03:00
const image =
2022-12-07 02:30:07 +03:00
post?.extra?.image || "https://storage.googleapis.com/media.urbit.org/site/opengraph/sig-white.png";
2022-06-22 23:54:19 +03:00
return (
<>
2022-12-07 02:30:07 +03:00
<link rel="icon" type="image/png" href="/images/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/images/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/images/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/images/favicon-16x16.png"
/>
<link rel="manifest" href="/images/site.webmanifest" />
2023-09-22 02:56:51 +03:00
<link rel="preconnect" href="https://3EVOAL3MOI-dsn.algolia.net" crossorigin />
2022-06-22 23:54:19 +03:00
<meta
name="twitter:card"
content="summary_large_image"
key="twitter-card"
/>
<meta name="twitter:site" content="@urbit" key="twitter-site" />
<meta name="twitter:creator" content="@urbit" key="twitter-creator" />
<meta
name="og:title"
content={`${title}developers.urbit.org`}
key="title"
/>
<meta name="og:description" content={description} key="description" />
<meta name="description" content={description} />
<meta name="author" content={author} key="author" />
{!disableImage && (
<meta name="twitter:image" content={image} key="image" />
)}
2022-07-02 00:26:06 +03:00
2022-12-07 02:30:07 +03:00
2022-06-22 23:54:19 +03:00
</>
);
}