-
Notifications
You must be signed in to change notification settings - Fork 17
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
Automatically follow links and download content? #27
Comments
You could add a |
Downloading the files in advance won't really work as there is neither a comprehensive list of files to download nor a good way to build such a list with exactly the needed files before the site is generated. But perhaps there is a way for generator to access the already built routes and retrieve a list of urls from it? |
Can you add some example code that shows how and when you determine which content to download? |
I have two dynamic urls, each used many times with different parameters:
In case that matters, they are being set to |
I have a lot of links like
/api/content/[content_id].[content_type]
(images and pdfs in my case) which fetch binary files from the API. Currently this content is served dynamically along with generated static app. I want to automatically download it and save to, say,/static
folder during the generation process.Do I have to write a function for that which manually replicates the file structure in order to do that and then run it at some of the build hooks (and then proxying
/api/content
URLs into/static
when serving), or is there at least a theoretical way to retrieve all these links during generation and make Node follow them, download and store the files mimicking the original url while rewriting the links in the process?If what I want is theoretically possible, but cannot be implemented right now with some configuration, I might consider digging into this and possibly making a PR at some point in case the idea makes sense.
The text was updated successfully, but these errors were encountered: