• Pages Generator

    schacon 23 Dec 2008

    Last week we released a feature for hosting your custom websites for your projects that we call ‘GitHub Pages’. For personal repositories, the process is easy enough – just create a repo named ‘username.github.com’. However, for project pages we faced a decision – do we ask you to create a new repository for each project page (ie: ‘myproject-pages’ or something), do we ask you to put a ‘website’ subdirectory in your project, or do we ask you to create an unrelated branch (ie, a branch that has no common ancestor with your project code)?

    The first option would be annoying, doubling everyone’s repository count. The second would dirty up your working directory with code you may not want released with your project. So we decided on the last, but the cost is that an unrelated branch is a concept that can be a bit confusing, in that some people create the branch and then don’t know how to get back to their source code after the process is complete (generally just a ‘git checkout master’, btw).

    So, we’ve simplified the process for you. Yesterday we pushed out a Pages generator for each project that will create your new branch and seed it with a nice looking website customized for your project. Then all you have to do is fetch it down and check it out to customize it if you feel so inclined.

    You can find the link on the ‘Admin’ tab (yes, you have to be the owner of the project for now). If you do not have a ‘gh-pages’ branch, you should see a ‘Generate Project Page’

    Click on that link and you’ll be taken to a form you can fill out to customize your project page:

    Any of these fields that you fill out will be used to create your initial web page. There are a few things that are brought in automatically, too. Your project name and description are pulled in (though you can change them), your contact information is added and your git project is scoured for contributors whom are all added.

    Furthermore, you can add your Google Analytics “Web Property ID” and it will add the javascript snippet for you. You can also choose a color (a random one is selected) for your page background color and our generator will automatically determine the complementary color to use for titles and links and whether to use a black or white foreground color for your text.

    So, if I fill this out and use the color that has been selected for me for my munger project and hit ‘Create Page’, I’ll see a message like this:

    And a few minutes later, I have a nice new page up at http://schacon.github.com/munger.

    The color choice there may not be your cup of tea, but you can choose any background color you want. It may be helpful as a starting point so you don’t have to do the whole ‘rm .git/index; blah blah’ stuff.

  • Comments

    davglass Tue Dec 23 19:55:30 -0800 2008

    This is awesome, great work guys…

    drnic Tue Dec 23 20:10:47 -0800 2008

    I feel I now misallocated my time last weekend on the jekyll_generator + sake tasks :/ doh

    drnic Tue Dec 23 20:11:37 -0800 2008

    Though the jekyll blog with Disqus comments is cool thing to have for each project.

    lennartkoopmann Wed Dec 24 03:29:21 -0800 2008

    Yay. Thank you for that christmas present! There seems to be a litte design issue: The MIT license floats out of the div on Firefox 3/Linux

    ashchan Wed Dec 24 03:55:27 -0800 2008

    Cool. It’s fun that we could create page for the user.github.com itself.

    lucashungaro Wed Dec 24 10:24:17 -0800 2008

    Tried to use the feature and it “reseted” my repository (all code and the master branch were gone, and an empty branch called gh-pages was created). I was able to restore it, but I think I won’t use this anymore. :(

    lucashungaro Wed Dec 24 10:29:23 -0800 2008

    Just to be clear, the page is there now, but the remote master branch vanished in the process. Everything ok now, but was weird.

    samnardoni Tue Dec 30 11:55:25 -0800 2008

    Very nice work, guys!

    Soleone Thu Jan 01 10:12:27 -0800 2009

    F**k, can Github become any better than this? I am always amazed by you guys, thanks a lot!!

    paltman Mon Jan 05 18:44:18 -0800 2009

    It appears to be disabled for my repos. It says you are trying to resolve a bug with the generator. What’s the status with that?

    schacon Tue Jan 06 15:24:30 -0800 2009

    this was turned off for a while so we could make sure @lucashungaro’s problem does not ever happen, and it’s back on now.

    trans Thu Jan 08 05:56:56 -0800 2009

    I think using a branch is a poor idea. Most projects maintain there website files in their repo. So why not just allow us to designate the internal directory. For instance I store my site files in web/ or doc/ depending on the size of the website. I have no desire to maintain a separate branch for this material. In other words, I’d much prefer you pollute my directory space than my branch space. And there is a very good reason for it too. The website is versioned in sync with the project itself.

    schacon Fri Jan 09 09:50:35 -0800 2009

    it was a difficult decision to make, but we figured that if you make a bunch of changes to the website you and your collaborators don’t want to see that messing up the commit history. if you want you have it as a subdirectory, make a submodule in your app that points to the internal branch. @drnic agrees with you and doesn’t like this as much as a directory so he made a sake task that does the conversion and submodule linking : http://drnicwilliams.com/2008/12/21/migrating-project-websites-to-github-pages-with-sake-tasks-new-websites-with-jekyll_generator/

    trans Sun Jan 11 19:49:43 -0800 2009

    I can understand, but website changes usually happen in spurts. I don’t think the cleaner commit history really makes up for the disadvantages of using a special branch. Personally, I’ve tried to convince the git people to add commit tags so commits could be marked and queried accordingly. In the case of modifying the website, one could tag the commits ‘web’ or such. That would be a more appropriate approach to the issue. But of course it requires support from git itself. The problem with a branch is that you now always have to make an exception for that branch. It has to be checked in and out separately, automated tools may need to be aware of it’s special use, and fundamentally speaking, it misrepresents the purpose of a branch. If you really wanted to separate the website form the rest of the project, you would make a new git repo altogether. I don’t want that myself, but that would be the more appropriate means. I hope ultimately the GitHub team will reconsider. In the mean time I will simply continue to host my pages with Rubyforge, and not use the Pages feature, as much as might like to.

    mazuhl Mon Feb 09 03:58:43 -0800 2009

    @lennartkoopman — you can fix this by getting the Firefox Stylish extension and adding in a rule like…

    pre { overflow: auto !important; }

    … for Github subdomains/pages.

    That might be a useful addition to the stylesheet/HTML for all the pages using this form.

    Deceth Thu Jul 16 08:30:58 -0700 2009

    Is there a way to regenerate my page? I'd like to add more information that I left blank, change the background color, etc...

    Is the only way to change this to edit the HTML?

    alexdenipaul Thu Jul 30 05:09:03 -0700 2009

    That's ok! It's my first software so we'll see how it goes dsl. If you have the know-how to make your own more complicated software I think you'll go places!

    I can only track traffic to this hub through HubPages. Unfortunately my blogs are hosted free by someone else (ie not my own dotcom) so I can't really monetize them too much. But I figured I'll give this Landing Page Generator away this time and see how it goes. Thanks for dropping by!

    Please log in to comment.