Hacker News new | past | comments | ask | show | jobs | submit login
How to host and manage static sites (of unlimited size) for free on Github (github.com/maxogden)
90 points by maxogden on Dec 6, 2012 | hide | past | favorite | 32 comments



I had a problem with Github user pages for the past few months: It stopped building.

At first I was more than happy that for every commits, I can see the changes immediately, but after few days, it just keep showing the old build. I even started a fresh new accounts and setup a new user page, same thing happened. I tried many things to make it work, adding/removing CNAME, changing the page content, even waiting for few days, no luck. Tried to contact the Github team (via Twitter and the Contact Us page), no respond.

Now I am using my shared VPS to host a static site, waiting for some good news about build reliability, until then I wouldn't recommend using Github user pages.

Oh and by the way, if you set a CNAME, you wouldn't be able to access your project pages without adding it as a submodule into your user page.


I put up a static page a couple of weeks ago with no issue. Granted, I'm not using Jekyll and just generating the static files on my own locally before committing / pushing.


I'm using Pelican as a static blog engine, had no issue at first, this happened after the number of commit grow.


wow very weird, I haven't had any issues like this


Hmm, strange symptoms. I haven't any issues like this. I've been using github pages + CNAME + gh-pages as project pages together for over a year without any issues whatsoever. Didn't have to worry about submodules either. Not sure why you're into these issues, kecebongsoft. I've used Jekyll as well as plain old html. I'm sorry you've had issues like this but I wouldn't discourage people from trying it either.


I wonder if people start abusing this if Github were to put any restrictions on it somehow. For quick one off single page things sure why not, but if people start trying to host huge websites on Github? I'd be curious as to their response.


Yeah, this is ripe for abuse by pornographers. :(


We may, but have no obligation to, remove Content and Accounts containing Content that we determine in our sole discretion are unlawful, offensive, threatening, libelous, defamatory, pornographic, obscene or otherwise objectionable or violates any party's intellectual property or these Terms of Service.

and

If your bandwidth usage significantly exceeds the average bandwidth usage (as determined solely by GitHub) of other GitHub customers, we reserve the right to immediately disable your account or throttle your file hosting until you can reduce your bandwidth consumption.

I wouldn't worry too much about it.

https://help.github.com/articles/github-terms-of-service


Really? Care to expand? That just surprises me!


I'd imagine the bandwidth for a porn site is huge, imagine having all that bandwidth dealt with by someone else for free! plus the porn industry tends to get in on new technologies early so Id be surprised if there isn't some somewhere.

Unrelated to porn this sort of thing could be great in general as all the content is searchable it would be a goldmine for information on how to use a function or do some specific action. I already use git as a codex of sorts!


> I wonder if people start abusing this if Github were to put any restrictions on it somehow.

They'll have to restrict it to some extent, but neither is it 1995 anymore. GeoCities was able to make a go of 15MB per free website (with bandwidth caps) for 14 years (1995-2009), and it's still available in Japan, but I don't know the current terms.

Serving static content you don't pay for from storage you already own down pipes you already pay for is just about the cheapest way there is to be online by any metric. I wouldn't be surprised if they could support a fairly large number of websites without blinking.


Great for hosting documentation, blogs, brochure sites or simple static clients: push your API code on master and other branches and have your static client to consume from the API on the gh-pages branch.

Be careful though, if you push something on gh-pages it will be public, even if your repo is private.

From what the guys at Github told me, they don't have to restrict their users as long as you don't commit obvious abuses. Either very large files or gigantic amount of files, which will both create issues with Git. In short, "don't be a dick".


Github pages is a fantastic service. I use it as an automatic archive for a daily mailing list: https://github.com/simon-weber/the-listserve-archive.

Basically, Github is my free host, database and api.


...if you give something for free and don't set limits, people will find ways to abuse it ...and then you'll have limits for everyone ...I ask all web developers out there to not use Github pages for clients' websites, it's not like you don't have room in the budget for almost-free webhosting for static websites, it's probably something like 0.(...)1% of website maintenance and dev costs and there already are free blog hosting services. use github for your website/blog, you family's, your pet's, but not for your clients', please...


A lot of clients are actually willing to pay for you to host their site, just as long as they don't have to do anything technical. We're talking £350 for a year in a lot of cases and the site could simply be an addon domain on a package with a few sites on it. This also includes a walk through of setting up emails on Outlook, iPhone or what have you.

They just don't care because you end up doing something that takes you 5 minutes and little to no energy which would be next to impossible for them.

Since the margins are so high, you also have freedom to make nice discounts without a loss.


OT, but I'd love to know what HN think about this:

The license part of the README.md says "The content in this repo is BSD licensed".

AFAIK licensing requires:

- A copyright line with the year (or years) and the name of the copyright holder.

- IIRC a way to contact the copyright holder is required (email, URL, etc), but I may be wrong and it's just optional.

- A copy of the license grant/notice is required, ie. the "boilerplate notice" form Apache license that includes a link to the full license text.

In this case, does the "The content in this repo is BSD licensed" sentence have any kind of effect?

EDIT: ate a word, formatting


(IANAL, most familiar with UK rules)

Generally a author has copyright over their works without having to explicitly says so. Saying "Copyright (c) YYYY AUTHOR NAME" is just a way of asserting it to remove potential confusion or ambiguity.

With no licensing, there is no right to use a copyright work (except fair use). BSD licensing a work is granting permission is a set of circumstances, not revoking permission. Thus if a license is not correctly applied the work cannot be used, rather than the inverse.

As for "The content in this repo is BSD licensed" - the usual licensing wording is again a convention designed to be as clear as possible, but the wording applied there probably counts as it pretty clearly intends to give permission. The "probably" is why people ought to stick to known and understood conventions.


I miss Geocities


You know what? Me too. I miss Geocities and I never realized until just now.

That was a great internet. The people's internet. I was 13 years old but I was allowed to make a website for free, with no help or direction from parents or teachers or anyone, with barely anything to learn.

And when I was done it was there. It was a thing I made on the internet and I could show anyone. And I did, and it was probably embarrassingly bad, but that's not the point.

I think more than anything in my career, services like Geocities inspired me.

See the internet? You can make it. You can do this stuff. It's not that hard.

Nobody else in my life told me that. Nobody explained to me that creating things on a computer wasn't magic, and if I wasn't enticed with such an easy website creator I may have never known.

What do I give my kids? What do I give my little cousins, right now, at the age of 10, that even comes close?

---

Looking around there seem to be a few, but they're all so template-centric that I wonder if I'd feel the same way if I had them back then.


I think "view source" is one of the best features in web browsers.

It's nice that anyone can peek behind the curtains and see that web pages aren't magic.


I wish I could upvote this comment more than once.

I remember getting on Geocities in 1996 and finding a burgeoning community, full of randomness and fun, all learning as we went along about how build websites. I remember mine was in the “Bourbon Street” “neighbourhood”.

I had a lot of fun that year, messing about on IRC, learning HTML, building (ugly :-) websites, helping others do the same. Can't believe I sound nostalgic about that place.

I think I'll set up my daughter (nearly 9, already has her own domain) with a GitHub account, and set up Pages so she can play with HTML, CSS and stuff.


Same here. I remember in '97 my grandma bought me a Geocities "plus" (or whatever it was called) account so I could have a geocities.com/~username vanity address. All my real life nerd friends were so jealous of me. :-)

Having free home pages on Geocities did a lot for my career. What will my son gain from whatever "social" web site is around when he starts using a computer (and yeah he also already has his own domain name)?


ha! That's exactly how I started a bit more than 10 years ago. IRC, geocities, and a bunch of ugly websites.

My father always used to say "Leave the computer alone and do your homework. No one will pay you for 'playing' on the computer".

5 years later he was my first paying client. Nowadays people only pay me when I "play with my computer".


Something has been lost in the evolution from home pages to Facebook and Twitter. The creation part of the equation has been reduced down to nothing more than choosing a picture to stick in a predefined slot.

I miss when people I know used LiveJournal. LJ encouraged people to write, long form. Then came MySpace and the birth of the status update, which was on even ground with the blog feature. Then Facebook banished blogging to the "Notes" area that nobody ever read, while elevating the status update to the central communication channel. Then, of course, Twitter boiled it down to nothing but status updates.

I miss when more average Internet users made home pages. I miss when more of them blogged, and participated in communities that revolved around the blog format rather than status updates.


  > Then, of course, Twitter boiled it down to nothing
  > but status updates.
IIRC, Facebook copied the 'status updates / news feed' idea from Twitter.


Seems like a good place to link to "Poll: What's your favorite static site generator?"[1] submitted a few days ago. The most interesting notion to take away is that, for all the buzz surrounding static site generators like Jekyll and Pelican, you can actually accomplish the same goal using absolutely any backend you're comfortable with. As long as your output doesn't contain anything dynamic, you can even use frameworks like Django or Rails then pair this with a spider (e.g. wget) to pull all the dynamically-_generated_ output into a static snapshot that you then upload to GitHub.

[1] http://news.ycombinator.com/item?id=4857473


What it isn't: a dynamic host -- so it can't do PHP/Rails/Node etc.

Seems like a good opportunity for sever-less folks like WebScript.io or Firebase to jump in and help.


Is the ability to use custom domains free now? In the past I thought you had to be under one of the paid github plans.

Oddly enough, I don't see any mention of this in the github article explaining how to set up a custom domain: https://help.github.com/articles/setting-up-a-custom-domain-...


I've been using a custom domain (for free) for over a year now. Really cool for simple static sites.


In the root of your repo on the gh-pages branch:

echo example.com > CNAME

Then point it (if apex) at 207.97.227.245.


You can also create a static file blog with Jekyll https://github.com/mojombo/jekyll.

Pretty awesome and simple.


Does one have to make the _yourusername_.github.com repo first for this to work? My understanding is that the Pages feature is only activated by doing this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: