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