-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
proposal: Add a "file proxy format" #5752
Comments
Interesting idea. Random comments:
If the hosting server allows it, we could use HTTP HEAD to retrieve headers without the body. Are you proposing to cache these resources elsewhere in the project and commit the cache to git? I'm concerned about reproducible builds. I'd tweak the format just a tad to add a
|
No, I'm proposing to use the existing file cache in Hugo, which can be used however you will:
Note that with remote resources there will be plenty of error scenarios, but the "reproducible builds" would be bulletproof when it works (assuming you trust SHA256). |
This is related to #5749 -- but I think that concept has a wider potential even if the title of this issue may seem a little out there (I just made it up quickly), so I quickly jot down some thoughts here.
The above is an example of a Git LFS placeholder for an image. It doesn't say where to find the image, but I guess it assumes to be in the current "Git LFS" repo.
We will add remote support for
resource.Get
so you can do{{ resource.Get "https://bep.is/sunset.img }}
etc. which is super cool, but has some limitations:Without additional information we would have to download the file (or an ETag) on every build to check if it has changed.
It would not work in page bundles.
If we could create a bundle:
And
sunset.jpg
would contain something ala:The above would probably need some help from some utility (like
hugo fetch image
) because it would be too hard to write by hand. But it has some benefits:The text was updated successfully, but these errors were encountered: