fix(v2): make correct Open Graph title for doc page (#2475)

This commit is contained in:
Alexey Pyltsyn 2020-03-29 07:12:07 +03:00 committed by GitHub
parent 92f2c52034
commit cffb3f9af5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,6 +76,7 @@ function DocItem(props) {
},
} = DocContent;
const metaTitle = title ? `${title} | ${siteTitle}` : siteTitle;
let metaImageUrl = siteUrl + useBaseUrl(metaImage);
if (!isInternalUrl(metaImage)) {
metaImageUrl = metaImage;
@ -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} />