Androbaut
Androbaut

Reputation: 409

Best image hosting solution for static site?

I'm working on a Jekyll project hosted on Github Pages, and wondering what the most advisable way to host images might be.

Right now, all the site's images are hosted on AWS, which is fine, but adds a (slight) amount of complexity. Total number of images hangs around 200+, and probably won't go over 500 for the foreseeable future.

I'd been advised by peers to NOT host images on Github Pages, but haven't gotten any concrete answers as to why one shouldn't.

Upvotes: 3

Views: 1810

Answers (2)

Adam Hollett
Adam Hollett

Reputation: 431

I don't think there's any problem with hosting images on GitHub Pages, or with including images alongside your code. Git and source control work really well for code, yes, but that doesn't mean that you should never store binary files in source control.

If you want to include images in your GitHub Pages repo, go ahead and do it. I haven't seen anything in the GitHub Pages documentation that suggests you shouldn't do it.

Furthermore, GitHub actually has pretty good support for comparing different versions of images in source control, so if you do commit images to your repo, you'll be able to compare changed versions side-by-side or by using a slider or fade effect.

Upvotes: 4

Zombo
Zombo

Reputation: 1

The problem is not putting images in version control. The problem is putting images in version control alongside your code. If you want to host a separate repo for images only, knock yourself out, but do not include them in a repo with actual code.

The great aspect of a site like GitHub is it makes software collaboration easier. I can:

  1. fork a project
  2. make changes
  3. commit
  4. pull request

http://hub.github.com#contributor

Adding images to a code repo makes software collaboration harder.

  1. Anyone who wants to clone your repo is going to have to deal with the extra size, unless you put the images on a different branch, then they can do git clone --single-branch

  2. Images do not really belong in version control. Version control is great because you can do line or word diffs for each change, to see how the code changes over time. You are never going to diff an image

For code, Git is much better option than AWS. For images, you should be asking yourself: what does Git do for images better than AWS. The answer is nothing really other than allowing you to put everything together. It is tempting, but I would really avoid doing this.

Upvotes: 3

Related Questions