-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-source-filesystem] createRemoteFileNode replaces original filename with hash #3132
Comments
What's the use-case where you'd like the original image name to remain? Do you expect the user to download images? |
As pointed out in #2306, descriptive image file names containing keywords are important for SEO. Plugins such as gatsby-source-wordpress download media from remote sources using createRemoteFileNode (I see now that gatsby-source-wordpress is the only one working like that at the moment?). Thanks! |
Is there any documentation describing how to use createRemoteFileNode and also about how it works? I wanted to know the best method to handle files and images from a headless CMS while working on a gatsby-source plugin. @calcsam @nik-s @KyleAMathews |
@ajayns It looks like the docs for |
@m-allanson Could you brief me a bit about it then? That'd help me for now and maybe that;d help me come up with a PR. |
@m-allanson Okay that's great! |
Per the original request — we should keep the original name + a bit of hash at the end. The hash is to differentiate between files named the same but from different places in the domain e.g. there could be a dozen files named avatar.jpg but which are all different. |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
If files are downloaded through createRemoteFileNode the original filename is replaced by digest.
The problem is that if you download images you lose the descriptive filenames (a similar issue has already been fixed in gatsby-plugin-sharp #2752).
Would it be possible to append the original filename to digest? I know that
path.parse(url).ext
could be replaced withpath.parse(url).base
in gatsby-remote-file-node.js, however I'm not sure how this will work in cases such as #2985.Thank you.
The text was updated successfully, but these errors were encountered: