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

No documention on using files cached by createRemoteFileNode #5147

Closed
ajayns opened this issue Apr 26, 2018 · 9 comments
Closed

No documention on using files cached by createRemoteFileNode #5147

ajayns opened this issue Apr 26, 2018 · 9 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@ajayns
Copy link
Contributor

ajayns commented Apr 26, 2018

While working with remote files, the current documentation that we wrote is pretty clear on how to use the function, but I feel we need to add an example of how to use such files in a Gatsby project.

@m-allanson @KyleAMathews

@KyleAMathews
Copy link
Contributor

Makes sense! Would love a quick example added of how you can then query the local file.

@ajayns
Copy link
Contributor Author

ajayns commented Apr 26, 2018

Is there any existing use case that you can point me to, so that I can work on a PR? @KyleAMathews

@KyleAMathews
Copy link
Contributor

@ajayns
Copy link
Contributor Author

ajayns commented Apr 27, 2018

Isn't that specifically for images? Wouldn't it be better to add an example for general files so that they include linking documents, videos and everything else as well. @KyleAMathews

@KyleAMathews
Copy link
Contributor

Your hypothetical example can be about whatever you'd like it to be :-)

@ajayns
Copy link
Contributor Author

ajayns commented Apr 27, 2018

So in cases of files, I was thinking the data URL can be queried by relativePath in Gatsby, and then used in the project as <a href="path-here">File</a>.
Is this approach advisable?

@KyleAMathews
Copy link
Contributor

No — createRemoteFileNode is only for use by source/transformer plugins that know about a remote file and want to pull it locally. The downloaded files aren't findable via directly searching. That's why the examples on source-filesystem and source-wordpress have you querying the file through other data.

@ajayns
Copy link
Contributor Author

ajayns commented Apr 28, 2018

Oh I wasn't aware of that. So in the case of remote files, say a PDF and maybe even a mp4 video that's stored in the CMS, what's the best approach to sourcing these files in a plugin? @KyleAMathews

Also, I'll try to add an example usage to the wordpress handling images only then.

@ajayns
Copy link
Contributor Author

ajayns commented Apr 29, 2018

Before I close this issue, I'd really appreciate a bit of help from the community on how to handle remote files as mentioned above! Any suggestions on best approach are appreciated!

@m-allanson m-allanson added the type: question or discussion Issue discussing or asking a question about Gatsby label Apr 30, 2018
@ajayns ajayns closed this as completed May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants