mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(v2): make correct Open Graph title for doc page (#2475)
This commit is contained in:
parent
92f2c52034
commit
cffb3f9af5
1 changed files with 3 additions and 5 deletions
|
@ -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} />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue