-
Notifications
You must be signed in to change notification settings - Fork 10.3k
fix(gatsby-remark-copy-linked-files): respect assetPrefix #26976
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
Conversation
…ertions - it doesn't inspire confidence
`/undefined/undefined.gif` | ||
fileLocationPart |
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.
this and other adjustments are not necessary for this PR, but as I looked to add cases for assetPrefix I noticed those undefined
there in expecteted strings and thought that it doesn't inspire a lot of confidence in those tests so I adjusted tests to specify internal.contentDigest
and name
fields on File nodes so those are more specific assertions
Gatsby Cloud Build Reportgatsby 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 21m |
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.
lgtm
Successfully published:
|
…6976) * test(gatsby-remarkc-copy-linked-files): get rid of "undefined" in assertions - it doesn't inspire confidence * fix(gatsby-remark-copy-linked-files): honor assetPrefix correctly Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
Description
Function that generates urls in
gatsby-remark-copy-linked-files
is not compatible withassetPrefix
- current path joining result in something like/https:/cdn.your-domain.com/{generated-hash-values}/demo.svg
(note that first character in front of protocol part).This PR changes to URL generation to match what
gatsby-plugin-sharp
already do (which is just doing string manipulation, becausepathPrefix
is already passing in form that allows for it - it strips trailing slash always, which means that using${prefix}/some/path
will work correctly):gatsby/packages/gatsby-plugin-sharp/src/index.js
Lines 142 to 145 in 8ad565f
Related Issues
Fixes #25918