diff --git a/packages/docusaurus-theme-classic/src/theme/DocItem/index.js b/packages/docusaurus-theme-classic/src/theme/DocItem/index.js index 96b77ffa091a..69e45d6f1ef5 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocItem/index.js +++ b/packages/docusaurus-theme-classic/src/theme/DocItem/index.js @@ -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 ( <> - {title && ( - - {title} | {siteTitle} - - )} + {metaTitle} + {description && } {description && (