diff --git a/components/content/ContentHead.tsx b/components/content/ContentHead.tsx
index 5b32374..a954241 100644
--- a/components/content/ContentHead.tsx
+++ b/components/content/ContentHead.tsx
@@ -36,6 +36,9 @@ export default function ContentHead(props: {
webmentionUrl = buildUrl({ host, pathname: '/api/social/webmention', searchParams: { resource } });
}
+ const url = buildUrl({ host, pathname: '/' });
+ const thumb = buildThumb(contentOwner, host, content);
+
return (
{title}
@@ -57,90 +60,22 @@ export default function ContentHead(props: {
{description}
-
-
-
- {content && webmentionUrl ? : null}
- {content?.commentsCount ? (
-
- ) : null}
- {contentOwner ? : null}
-
- );
-}
-
-// This needs to be filled out by the developer to provide content for the site.
-// Learn more here: http://ogp.me/
-function OpenGraphMetadata({
- contentOwner,
- content,
- title,
- host,
-}: {
- contentOwner: UserPublic;
- content?: Content;
- title: string;
- host: string;
-}) {
- const thumb = buildThumb(contentOwner, host, content);
- return (
- <>
+ {/* This needs to be filled out by the developer to provide content for the site. Learn more here: http://ogp.me/ */}
- >
- );
-}
-function buildThumb(contentOwner: UserPublic, host: string, content?: Content) {
- let thumb;
- if (content?.thumb) {
- thumb = content.thumb;
- if (!/^https?:/.test(thumb)) {
- thumb = buildUrl({ host, pathname: thumb });
- }
- }
-
- if (!thumb) {
- thumb = buildUrl({ host, pathname: contentOwner?.logo || contentOwner?.favicon || '' });
- }
-
- return thumb;
-}
-
-// This needs to be filled out by the developer to provide content for the site.
-// Learn more here: https://developers.google.com/search/docs/guides/intro-structured-data
-function StructuredMetaData({
- contentOwner,
- content,
- title,
- host,
-}: {
- contentOwner: UserPublic;
- content?: Content;
- title: string;
- host: string;
-}) {
- const url = buildUrl({ host, pathname: '/' });
- const thumb = buildThumb(contentOwner, host, content);
-
- return (
-
- );
-}
+ }}
+ />
-// TODO(mime): meh, lame that this is in the but I don't feel like moving this to HTMLBase where we don't have
-// contentOwner currently.
-function GoogleAnalytics({ contentOwner }: { contentOwner: UserPublic }) {
- return (
- <>
-
-
+ {content && webmentionUrl ? : null}
+ {content?.commentsCount ? (
+
+ ) : null}
+ {contentOwner ? (
+
+ ) : null}
+ {contentOwner ? (
+
- >
+ }}
+ />
+ ) : null}
+
);
}
+
+function buildThumb(contentOwner: UserPublic, host: string, content?: Content) {
+ let thumb;
+ if (content?.thumb) {
+ thumb = content.thumb;
+ if (!/^https?:/.test(thumb)) {
+ thumb = buildUrl({ host, pathname: thumb });
+ }
+ }
+
+ if (!thumb) {
+ thumb = buildUrl({ host, pathname: contentOwner?.logo || contentOwner?.favicon || '' });
+ }
+
+ return thumb;
+}