-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Open Graph images can be inserted as base64, preventing social previews #9345
Comments
Can you please explain a little bit more about this issue |
@thats-sarthak, the issue is that the docusaurus/packages/docusaurus-mdx-loader/src/loader.ts Lines 65 to 73 in 0624007
To fix this, we would probably need to use |
I didn't try but we already have something like that while processing Markdown images so that they don't get unexpectedly converted to ideal images. I guess we could reuse the same logic: const {
loaders: { inlineMarkdownImageFileLoader }
} = getFileLoaderUtils();
const requireString = `${inlineMarkdownImageFileLoader}${escapePath(
relativeImagePath
) + search}`;
attributes.push({
type: "mdxJsxAttribute",
name: "src",
value: assetRequireAttributeValue(requireString, hash)
}); Let me know if you want to send a PR |
Hey Seb! Thanks for the info, I'm keen to send a PR, give me a couple days ;-) |
I've tried two things:
This is done in this commit.
This is done in this commit. |
Yes indeed it doesn't work you'd need to create a new inline loader string that only uses file-loader and not url-loader. You can name it Please submit a draft pr, it's easier to review than individual commits |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
When building the site, some
og:image
are inserted as base64 data, instead of as a URL.This prevents the image from being visible when sharing the blog post on Twitter, Slack, Signal, etc.
Example:
which makes the image not visible in social previews (testable with opengraph.xyz)
which makes the image showing up correctly (opengraph.xyz).
Code available at github.com/zwyx/zwyx.dev.
Reproducible demo
https://github.com/Zwyx/zwyx.dev
Steps to reproduce
Please see description.
Expected behavior
Please see description.
Actual behavior
Please see description.
Your environment
2.4.1
Self-service
The text was updated successfully, but these errors were encountered: