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(theme): add support for meta og locale and alternates #9152

Merged
merged 3 commits into from Jul 28, 2023

Conversation

FlorinaPacurar
Copy link
Contributor

@FlorinaPacurar FlorinaPacurar commented Jul 17, 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.

Motivation

Fix #8887 by adding og locale and alternates

Test Plan

Tested locally in browser with suggested config
Screenshot 2023-07-17 at 17 13 04

Test links

Deploy preview: https://deploy-preview-9152--docusaurus-2.netlify.app/

Related issues/PRs

issue #8887

@netlify
Copy link

netlify bot commented Jul 17, 2023

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 1fac61f
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/64c393738e6054000807d561
😎 Deploy Preview https://deploy-preview-9152--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 configuration.

@github-actions
Copy link

github-actions bot commented Jul 17, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 89 🟢 97 🟠 83 🟢 100 🟠 89 Report
/docs/installation 🟠 74 🟢 100 🟠 83 🟢 100 🟠 89 Report

@Josh-Cena
Copy link
Collaborator

Hello, #8894 already exists. Thank you for your interest but please check existing PRs first.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

Thanks, almost looks good.

This should rather be handled in theme/SiteMetadata (theme) instead of SiteMetadataDefaults because supporting og locale attributes is opinionated, shouldn't be mandatory for users and we should give them the ability to remove support if they don't want it (which would reduce the size of the html pages).

See location of original PR here: #8894

packages/docusaurus/src/client/SiteMetadataDefaults.tsx Outdated Show resolved Hide resolved
packages/docusaurus/src/client/SiteMetadataDefaults.tsx Outdated Show resolved Hide resolved
packages/docusaurus/src/client/SiteMetadataDefaults.tsx Outdated Show resolved Hide resolved
@FlorinaPacurar
Copy link
Contributor Author

Thanks @slorber - updated.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

Looks good 👍 just requesting minor code changes

@slorber slorber changed the title feat(core): generate meta og locale and alternates issue #8887 feat(theme): add support for meta og locale and alternates Jul 28, 2023
@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Jul 28, 2023
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

LGTM thanks 👍

@slorber slorber merged commit 5e147e8 into facebook:main Jul 28, 2023
30 of 31 checks passed
slorber pushed a commit to VinceCYLiao/docusaurus that referenced this pull request Aug 3, 2023
This was referenced Oct 19, 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: new feature This PR adds a new API or behavior.
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
4 participants