-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
fix: always emit SEO title + og:title meta #7362
fix: always emit SEO title + og:title meta #7362
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me 👍
Actually, I'm not sure 😅 In this case, |
ok. 明白了 验证没啥问题感觉发布吧 🔥 大佬原来是国人呀 哈哈 |
这个 bug还没合并吗? |
@lkzwc Please check the discussion above. Please don't ask about progress—all progress is evident on GitHub. |
Ah yes @slorber this needs review & merge for today's release as well. We should remove the |
What I understand is that a page not using That would have been convenient to give an example URL to make review easier and see the problem in action: https://docusaurus.io/tests/pages/link-tests Your solution fixes it, and https://deploy-preview-7362--docusaurus-2.netlify.app/tests/pages/link-tests Note that It is supposed to be used 0-n times for a given page, and it's possible that multiple usages override each others according to the order/hierarchy (similar to the React-Helmet doc) I don't want to remove <PageMetadata title="xyz"/>
<PageMetadata description="ABC"/> Then the last component will override the title that was previously set. So the current solution is not ideal, will look into fixing it in a better way, ensuring |
To summarize our discussion about this:
It's not entirely sorted out—we would probably revisit this next week, refactor it, and probably spec it somewhere (not necessarily public documentation; code comment, most likely). |
- removed siteconfig.title and description from the <Layout> portion as mentioned in facebook/docusaurus#7362
Pre-flight checklist
PageMetadata
and I can't find any examples of testing a component like this in the codebase (React isn't my strong suit). If you can point me to an example of how something like this would be tested, happy to add some tests for this.Motivation
<meta property="og:title" content="..." />
tags aren't generated for pages using<Layout>
without specifying a page title.ie.
<Layout>...</Layout>
does not generate a<meta property="og:title" content="..." />
tag for the page, whereas<Layout title="My page">...</Layout>
does generate themeta
tag.This causes the page to fail Twitter's Card Validator.
A default
<title>
tag seems to get rendered elsewhere, but for completeness, I've changed the behaviour for both tags here.Test Plan
Manual verification with local site.
PageMetadata
and I can't find any examples of testing a component like this in the codebase (React isn't my strong suit). If you can point me to an example of how something like this would be tested, happy to add some tests for this.Test links
Deploy preview: https://deploy-preview-7362--docusaurus-2.netlify.app/
Related issues/PRs
(none)