Skip to content

Commit

Permalink
apply siteTitle as default title
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed May 27, 2022
1 parent 1f45965 commit a54511b
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 a54511b

Please sign in to comment.