Skip to content
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(create-docusaurus): add useBaseUrl for image URLs #6368

Merged
merged 1 commit into from
Jan 15, 2022

Conversation

alias-mac
Copy link
Contributor

Motivation

This is already provided by the classic template and in TypeScript template wasn't updated.
Based on the documentation it is better to use useBaseUrl and I don't see the benefit of repeating the same function call in the FeatureList array.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Without this change it looks like this:
Screen Shot 2022-01-14 at 19 27 35

With the change applied the images load correctly:
Screen Shot 2022-01-14 at 19 29 43

This is already provided by the classic template and in TypeScript
template wasn't updated.
@facebook-github-bot
Copy link
Contributor

Hi @alias-mac!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@Josh-Cena
Copy link
Collaborator

Thanks! We also have some links that are not using useBaseUrl. Could you update them as well?

@Josh-Cena Josh-Cena added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Jan 15, 2022
@netlify
Copy link

netlify bot commented Jan 15, 2022

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 5080857

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61e23fcc115705000772cddc

😎 Browse the preview: https://deploy-preview-6368--docusaurus-2.netlify.app

@alias-mac
Copy link
Contributor Author

@Josh-Cena can you clarify which links are missing the useBaseUrl? All the links on the docs template seem to be working for me (when using a context). Also yarn build doesn't report broken links. What am I missing?

@Josh-Cena
Copy link
Collaborator

Oh, I realized that links automatically have base URL prepended :D Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 15, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 85
🟢 Accessibility 98
🟢 Best practices 93
🟢 SEO 100
🟢 PWA 92

Lighthouse ran on https://deploy-preview-6368--docusaurus-2.netlify.app/

@Josh-Cena Josh-Cena changed the title fix: import static images with baseUrl path fix(create-docusaurus): add useBaseUrl for image URLs Jan 15, 2022
@Josh-Cena Josh-Cena merged commit dd63a72 into facebook:main Jan 15, 2022
@alias-mac alias-mac deleted the fix-import branch January 16, 2022 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants