-
Notifications
You must be signed in to change notification settings - Fork 35
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
Storing PDFs and images #222
Comments
Hm, storing everything on GitHub does not work (google docs etc.). So there is probably no solution. |
Binary blobs bigger than a few KB should not be stored in a git repo. It will make cloning the repo very slow and if they are ever deleted they are still part of the git history. Also, with GitHub Pages the whole site cannot be more than 1GB which you would hit very quickly, and there is also a 100 GB bandwidth limit. What I like to do is drag-and-drop images in GitHub editors (or you can click the text "Attach files by dragging & dropping"). It will get uploaded to GitHub's CDN. Here is a visual guide: Another advantage is that GitHub will do compression for you so you don't have to do it manually (it's really sloppy to accompany a newsletter with a 3MB image). Oh, you can also upload PDFs this way. If that feels a bit shaky (uploaded images and files have no expiry but they could in theory disappear) we can set up an S3 bucket to upload images and files there. I would be happy to set up an account and the bucket. |
This tool can be used to delete existing binary files from the repo: https://rtyley.github.io/bfg-repo-cleaner/ |
I think it is best to use Cloudflare R2 to store binary files. |
Thanks for the feedback everyone! |
@wipfli Happy to use Cloudflare R2, but it is tied to [email protected], so I am unable to log in (2 factor auth). |
It's possible to work around this problem.
The image won't be part of the history of the main branch but will be still available via a direct link. For example:
And it's possible to embedd the image: This method could be used for all kind of binary data that doesn't exceed the maximum file size of 25 MiB. |
Wouldn't uploading images here in an issue thread much easier to achieve the same results? |
Last time I checked, images uploaded to issues can't be embedded outside of github.com, probably CORS related. |
I'm pretty sure I'm using images upload to github issues in my website... |
@josxha That would be your server's CORS blocking it then. |
That would be your server's CORS blocking it then. Good point. 👀 I checked and my assumption with CORS was not correct, too. Apparently images uploaded to a private repo stay as private after the repo became publicly accessable. Uploaded images, now in a public repo
Thanks for the sample Harel. This means posting the binary data in the related issue or pull requests could be used as well. 👍 |
In recent pull requests there has been some discussion about how to best store PDFs and images.
What we are doing at the moment is to have some pdfs / images in this git repo and some we get from 3rd party sources such as GitHub or Google Drive.
I think having multiple places to store images and pdfs is bad.
What is the best solution to this? cc @maxammann and @louwers
The text was updated successfully, but these errors were encountered: