Skip to content

Commit

Permalink
fix(v2): make correct Open Graph title for doc page
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Mar 28, 2020
1 parent 36ea745 commit b9ba0d0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/docusaurus-theme-classic/src/theme/DocItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function DocItem(props) {
},
} = DocContent;

const metaTitle = title ? `${title} | ${siteTitle}` : siteTitle;
let metaImageUrl = siteUrl + useBaseUrl(metaImage);
if (!isInternalUrl(metaImage)) {
metaImageUrl = metaImage;
Expand All @@ -84,11 +85,8 @@ function DocItem(props) {
return (
<>
<Head>
{title && (
<title>
{title} | {siteTitle}
</title>
)}
<title>{metaTitle}</title>
<meta property="og:title" content={metaTitle} />
{description && <meta name="description" content={description} />}
{description && (
<meta property="og:description" content={description} />
Expand Down

0 comments on commit b9ba0d0

Please sign in to comment.