Skip to content

Commit

Permalink
feat(core): generate meta og locale and alternates
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorinaPacurar committed Jul 17, 2023
1 parent 26ae416 commit 4716be0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/docusaurus/src/client/SiteMetadataDefaults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ export default function SiteMetadataDefaults(): JSX.Element {
*/}
<html lang={htmlLang} dir={htmlDir} />
<title>{title}</title>
<meta property="og:locale" content={htmlLang.replace('-', '_')} />
{Object.values(localeConfigs).map((config) =>
htmlLang !== config.htmlLang ? (
<meta
key={`meta-og-${config.htmlLang}`}
property="og:locale:alternate"
content={config.htmlLang.replace('-', '_')}
/>
) : (
''
),
)}
<meta property="og:title" content={title} />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{noIndex && <meta name="robots" content="noindex, nofollow" />}
Expand Down

0 comments on commit 4716be0

Please sign in to comment.