-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Bug (v2): Meta description outputting MDX import statements #2601
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
difficulty: intermediate
Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan.
help wanted
Asking for outside help and/or contributions to this particular issue or PR.
Comments
The fix might also fix #2607. A few suggestions I have:
Might be worth finding out how Gatsby and VuePress handles this. |
It is much better in this case to remove the MD, rather than compile it.
Yes, then React components will not be taken into account, although I do
not think that this will be a big issue, since it's rare that anyone would
use a React component at the beginning of a file.
вт, 14 апр. 2020 г. в 22:22, Yangshun Tay <[email protected]>:
… The fix might also fix #2607
<#2607>. A few suggestions I
have:
- Compile the Markdown/MDX into just text form before extracting the
description. This will incur a performance cost but would eliminate the
issue entirely
- Add a description front matter field to override the automatic
extraction of the description. This is troublesome for users but might be
useful to have either way
- Last resort - do the naive removal as proposed by @lex111
<https://github.com/lex111> in #2380
<#2380>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2601 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUIO2OP7BYY4AZZEECLPDRMSZYJANCNFSM4MHVN56Q>
.
|
@lex111 let's go with your previous PR. It's better than having a buggy result now. Maybe we can also filter out require statements to make it more robust. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
difficulty: intermediate
Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan.
help wanted
Asking for outside help and/or contributions to this particular issue or PR.
🐛 Bug Report
MDX import statements which are required to be placed on the first line of a doc (i.e. after the doc header section), are being used in meta descriptions.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
import MyComponent from '../src/components/MyComponent';
.Expected behavior
I expected to see the first line of my text in de meta descriptions.
Actual Behavior
The import statement is being used in the meta descriptions.
Your Environment
Reproducible Demo
(Paste the link to an example repo, including a
siteConfig.js
, and exact instructions to reproduce the issue.)https://github.com/Yoast/developer-site combined with https://github.com/yoast/developer-docs/
The text was updated successfully, but these errors were encountered: