Skip to content

Docusaurus does not generate og:locale and og:locale:alternate meta tags #8887

@JavorszkyGaborOrianaWorld

Description

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

The built site does not have og:locale and og:locale:alternate meta tags in the Head.

Reproducible demo

https://codesandbox.io/p/sandbox/zen-wildflower-kpuv6l?file=%2FREADME.md

Steps to reproduce

  1. Add at least two locales to docusaurus.config.js.
    e.g.
i18n: {
    defaultLocale: "en",
    locales: ["en", "hu"],
    localeConfigs: {
      en: {
        label: "English",
        direction: "ltr",
        htmlLang: "en-US",
        calendar: "gregory",
      },
      hu: {
        label: "Magyar",
        direction: "ltr",
        htmlLang: "hu-HU",
        calendar: "gregory",
        path: "hu",
      },
    },
  },
  1. Build
  2. Serve

Expected behavior

In the built site pages in the Head tag og:locale and og:locale:alternate meta tags are present.

 <meta property="og:locale" content="en_US" />
 <meta property="og:locale:alternate" content="hu_HU" />

Actual behavior

In the built site pages in the Head tag og:locale and og:locale:alternate meta tags are not present.

Your environment

  • Public source code: no public code
  • Public site URL: no public site
  • Docusaurus version used: 2.4.0
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
    • Microsoft Edge Version 112.0.1722.39 (Official build) (64-bit)
    • node --version: v18.13.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):
    • Edition Windows 11 Enterprise
    • Version 22H2
    • OS build 22621.1413

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.status: accepting prThis issue has been accepted, and we are looking for community contributors to implement this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions