Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): add og:locale and og:locale:alternative meta tags #8894

Closed
wants to merge 3 commits into from

Conversation

NotHr
Copy link

@NotHr NotHr commented Apr 14, 2023

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Related issues/PRs

Fix #8887

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 14, 2023
@netlify
Copy link

netlify bot commented Apr 14, 2023

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 13d71ae
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/643d7729e6bd910008ece5b4
😎 Deploy Preview https://deploy-preview-8894--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Apr 14, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 68 🟢 97 🟢 92 🟢 100 🟢 90 Report
/docs/installation 🟠 76 🟢 100 🟢 92 🟢 100 🟢 90 Report

.yarnrc.yml Outdated Show resolved Hide resolved
website/package.json Outdated Show resolved Hide resolved
@NotHr
Copy link
Author

NotHr commented Apr 14, 2023

I am having some issues with git. I need some time

@slorber slorber marked this pull request as draft April 14, 2023 17:04
@NotHr NotHr marked this pull request as ready for review April 17, 2023 13:17
@NotHr NotHr requested a review from slorber April 17, 2023 13:18
@NotHr NotHr changed the title Added og:locale and og:locale:alternative to staic site generation Added og:locale and og:locale:alternative to static site generation Apr 17, 2023
})}
hrefLang={htmlLang}
/>
<>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have to do <Fragment key={locale}> here instead

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 👍

@NotHr I think you could loop twice instead of using a fragment.

Probably not a big deal but it would look cleaner if hrefLang and og:locale:alternate were not "interleaved" in the final html markup.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

))}

<meta property="og:locale" content={defaultLocale} />
Copy link
Collaborator

@slorber slorber Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the currentLocale (and not the defaultLocale) as bcp47 code (htmlLang attribute like in hreflang links), but converted to og locale format (see #8887 (comment))

})}
hrefLang={htmlLang}
/>
<meta property="og:locale:alternate" content={locale} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, we should use the locale bcp47 code (htmlLang attribute like in hreflang links), but converted to og locale format (see #8887 (comment))

Also, it seems OpenGraph does not recommend outputting the current locale as an alternate

<meta property="og:locale" content="en_GB" /> 
<meta property="og:locale:alternate" content="fr_FR" />
<meta property="og:locale:alternate" content="es_ES" />
<meta property="og:locale:alternate" content="en_GB" /> ❌

@Josh-Cena Josh-Cena changed the title Added og:locale and og:locale:alternative to static site generation feat(core): add og:locale and og:locale:alternative meta tags Jul 17, 2023
@Josh-Cena Josh-Cena added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Jul 17, 2023
@FlorinaPacurar
Copy link
Contributor

@Josh-Cena - this PR doesn't have any activity since April and #9152 was already addressing the feedback here. Is there anything I can do to help merge this?

@Josh-Cena
Copy link
Collaborator

@NotHr Do you plan to address the feedback above?

@FlorinaPacurar Sorry for the confusion. For large PRs we usually close if it goes unresponsive, but for small ones, sometimes the maintainer just self-applies the change and merges. We'll wait a while and if there's still no response we can reopen yours since you were second to claim it.

@slorber
Copy link
Collaborator

slorber commented Jul 27, 2023

Hey 👋

Since @NotHr doesn't answer/update, let's move on and reopen @FlorinaPacurar PR.

@FlorinaPacurar can you take a look at my comments on this PR and make sure they are addressed on your PR too?

@slorber slorber closed this Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docusaurus does not generate og:locale and og:locale:alternate meta tags
6 participants