question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[gatsby-source-filesystem] createRemoteFileNode replaces original filename with hash

See original GitHub issue

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 thatpath.parse(url).ext could be replaced with path.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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ajaynscommented, Mar 1, 2018

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

1reaction
nik-scommented, Dec 5, 2017

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-source-filesystem
gatsby-source-filesystem A Gatsby source plugin for sourcing data into ... The helper tries first to retrieve the file name and extension by parsing...
Read more >
gatsby-source-filesystem | Yarn - Package Manager
A Gatsby source plugin for sourcing data into your Gatsby application from your local filesystem. The plugin creates File nodes from files. The...
Read more >
Replace special filename characters - DoubleLoop
Description Many source plugins use createRemoteFileNode to download files from CMSs and other sources. Windows has many reserved characters ...
Read more >
Gatsby Changelog | 5.3.0
In the PR feat(gatsby-worker): Show original stack trace we have now given ... gatsby-source-filesystem : Replace special filename characters, via PR #34249 ...
Read more >
Gatsby - fetching remote images with createRemoteFileNode
I've been trying to fetch images from remote URL to Gatsby Source File system, to take advantage of lazy ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found