-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Enable custom meta description for custom pages #752
Conversation
Deploy preview for docusaurus-preview ready! Built with commit 87dcf6a |
Nice catch. We only had
So, by default, we just use the |
@JoelMarcey this is only for custom pages like You can try Facebook URL Linter to crawl & check docusaurus open graph description 😄 |
I just didn't know of most people who use Docusaurus realized that they could do the above by adding the class property. 😄 |
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.
💯 Thanks!
Oh this is actually a new feature. I should document it like #712 |
Docs updated. Feel free to modify 👍 |
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.
Good documentation!
Motivation
For Your Information
<meta name="description" content="" />
Search engines show the meta description in search results mostly when the searched for phrase is contained in the description. Optimizing the meta description is a very important aspect of on-page SEO
<meta property="og:description" content="" />
This is used for Open Graph description meta. Usually used by crawler of social media like Facebook / Twitter
Have you read the Contributing Guidelines on pull requests?
Yes
Changes
Previously, all custom pages description will always be
tagline
because we never passdescription
props.https://github.com/facebook/Docusaurus/blob/18c01327a3082962165263c37b4a49d5426fbf53/lib/core/Site.js#L31
Adding custom description for your custom pages is as simple as adding description class property to your React component.
Example:
Test Plan
Facebook URL Linter
https://developers.facebook.com/tools/debug/
Before

After

https://totheweb.com/learning_center/tool-test-google-title-meta-description-lengths/
Before

After
