Skip to content

Commit 886a4f3

Browse files
authored
fix: correct meta tags for twitter (#218)
1 parent 255283a commit 886a4f3

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

website/app/routes/$owner.$repo.$.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export const meta: MetaFunction = (props: { data?: DocumentationLoader }) => {
4747
}
4848

4949
const socialPreviewImage = getSocialImage(props.data);
50+
const title =
51+
props.data.frontmatter?.title || props.data?.config?.name || props.data.repo || 'docs.page';
5052

5153
return {
5254
'twitter:card': 'summary_large_image',
@@ -57,14 +59,14 @@ export const meta: MetaFunction = (props: { data?: DocumentationLoader }) => {
5759
props.data.path ? `/${props.data.path}` : ''
5860
}`,
5961
'og:site_name': 'docs.page',
60-
'og:title':
61-
props.data.frontmatter?.title ?? props.data?.config?.name ?? props.data.repo ?? 'docs.page',
62+
'og:title': title,
6263
'theme-color': props.data.config?.theme ?? '',
63-
title:
64-
props.data.frontmatter?.title ?? props.data?.config?.name ?? props.data?.repo ?? 'docs.page',
64+
title,
6565
description: props.data.frontmatter?.description ?? '',
6666
'og:description': props.data.frontmatter?.description ?? '',
6767
'twitter:description': props.data.frontmatter?.description ?? '',
68+
'twitter:title': title,
69+
'twitter:text:title': title,
6870
};
6971
};
7072

website/app/routes/$owner.$repo.custom-styles[.]css.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)