-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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(pages): add support for missing SEO front matter + improve SEO docs #9071
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
@@ -74,6 +112,17 @@ export default function page() { | |||
<Layout title="Page" description="A React page demo"> | |||
<Head> | |||
<meta property="og:image" content="image.png" /> | |||
<meta name="twitter:card" content="summary_large_image" /> |
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.
Since this is generally about improving SEO docs. And front matter
is a pretty big deal for this, we should also in this same PR try to clean up some missing links about front matter
.
One thing I noticed above on line 61 is the mention of front matter
. That should probably be turned into a link to the page on front matter. In general, I've noticed we are pretty bad at just typing names, when they really should be links to their respective pages, especially anything like plugin, api, etc.
I think the general link for the feature would be appropriate here I think:
https://docusaurus.io/docs/markdown-features#front-matter
But I also notice we don't have a link to the API when we describe front matter on that feature section! Which should have a link to the API for the plugin, right? https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter
But we DO have an API link on the Create a Doc section about Doc front matter
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.
I'm not sure how this comment is related to the twitter:card
meta? 🤔
Will add links to front matter
Note: the SEO page is generic so it can only link to the generic front matter page.
It is normal that a docs page links to docs-specific front matter. Each plugin can have its own front matter.
To not bias toward a single plugin I'll add links to all the API ref supporting front matter:
- https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter
- https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog#markdown-front-matter
- https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-pages#markdown-front-matter (need to be created 😅 )
And yes, makes things absolutely much more clearer! I'll continue to see if there might be gaps in coverage for a few plugin API links, or maybe you could open a clean up issue for your team. |
Co-authored-by: Thad Guidry <[email protected]>
…ion, keywords, image
Size Change: +269 B (0%) Total Size: 1.04 MB
ℹ️ View Unchanged
|
@@ -234,6 +235,15 @@ export default function pluginContentPages( | |||
`${docuHash(aliasedSource)}.json`, | |||
); | |||
}, | |||
// Assets allow to convert some relative images paths to |
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.
Instead of a code comment here only, we might also consider a light mention about Assets and require()
calls with relative paths
, perhaps most especially in the API doc pages for plugin-content-pages
and additionally maybe an Admonition on the /docs/static-assets
page, which does mention require()
but skips saying anything about relative paths
? Anyways, just noting this since indeed relative paths
are one of the tricky things that I had to figure out on my own with Docusaurus' default asset paths handling! Maybe it's Caveats section could be expanded slightly, dunno.
Motivation
Ensure all content plugins have normalized support for these shared front matter: title, description, keywords, image
Pages:
Documentation:
<meta>
tags and not other tagsTest Plan
preview