Skip to content

Commit

Permalink
fix: always emit SEO title + og:title meta (#7362)
Browse files Browse the repository at this point in the history
Co-authored-by: sebastienlorber <[email protected]>
  • Loading branch information
charleskorn and slorber authored May 27, 2022
1 parent 49ecd8f commit 1e18f8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/docusaurus/src/client/SiteMetadataDefaults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ import useBaseUrl from '@docusaurus/useBaseUrl';

export default function SiteMetadataDefaults(): JSX.Element {
const {
siteConfig: {favicon, tagline, title},
siteConfig: {favicon, title},
i18n: {currentLocale, localeConfigs},
} = useDocusaurusContext();
const faviconUrl = useBaseUrl(favicon);
const {htmlLang, direction: htmlDir} = localeConfigs[currentLocale]!;

return (
<Head defaultTitle={`${title}${tagline ? ` · ${tagline}` : ''}`}>
<Head>
<html lang={htmlLang} dir={htmlDir} />
<title>{title}</title>
<meta property="og:title" content={title} />
{favicon && <link rel="icon" href={faviconUrl} />}
</Head>
);
Expand Down

0 comments on commit 1e18f8f

Please sign in to comment.