This repository contains the static web pages for the site at http://railsapps.github.io.
To update the content for this website, use the GitHub wiki:
To change the layout and design, edit the _Layout.html file and CSS and Javascript in the railsapps.github.io.wiki repository.
Then use the gollum-site gem to generate static web pages from the wiki. To commit the generated web pages, you’ll need repository read+write permission as an organization team member.
Here are the goals I had in mind when I set up the RailsApp site:
- I wanted to use GitHub’s capability for hosting the site. The hosting is free and the wiki is familiar to GitHub users. I didn’t want to deploy a dedicated CMS or use a wiki hosted elsewhere.
- I’d like any GitHub user to be able to add to the site (or make corrections) by editing the repository’s wiki pages directly.
- I like being able to edit the wiki pages locally using Textile markup and commit changes to the GitHub repository. I use the same text editor and workflow that I use for maintaining code.
- On its own, the GitHub wiki does not provide everything needed for the project website. I wanted to improve the layout and design to make the site more attractive and useful. I wanted to add Javascript for the Disqus commenting system as well as a Google Analytics tracking script. I anticipated I would use a tool such as Jekyll to combine the wiki files with a layout template and generate static web pages to upload to GitHub for site hosting.
- As the maintainer of the site, I anticipate generating static web pages from the wiki files periodically (or when I notice changes to the wiki pages or am alerted with a GitHub issue). I don’t need to have the site updated dynamically.
I looked at several static website generators, including Jekyll, and decided gollum-site most closely fit my requirements.
You can edit the wiki pages online. Alternatively, you can edit them locally in a text editor after cloning the repository.
Here’s how you can edit the pages locally and generate a new version of the website from the wiki pages.
The gollum-site gem is used to generate static web pages from the wiki.
Install the gollum-site gem plus the RedCloth gem (to support Textile markup).
$ gem install gollum-site RedCloth
Note that there are two repositories: the site repo (for the static web pages) and the wiki repo (for the wiki pages).
We’ll assume you will create a directory for the project and download the needed files.
$ mkdir ~/railsapps $ cd ~/railsapps $ git clone [email protected]:RailsApps/railsapps.github.io.git $ git clone [email protected]:RailsApps/railsapps.github.io.wiki.git
Make sure you are in the git “master” branch. Edit the wiki pages and commit any changes.
$ cd railsapps.github.io.wiki $ git checkout master ## edit wiki pages with a text editor $ git commit -am "update wiki"
To change the layout and design, edit the _Layout.html file and change any CSS and Javascript files in the railsapps.github.io.wiki repository. Then commit any changes.
## edit the *_Layout.html* file with a text editor ## edit the *css/screen.css* file with a text editor $ git commit -am "update layout"
When you are ready to generate the static pages, use the gollum-site gem to generate the static web pages in the wiki repo. Gollum-site has a built-in web server if you want to view the site locally before committing and publishing to GitHub.
$ gollum-site generate ## to generate static webpages in "./_site" folder $ gollum-site serve ## to view the static site at http://localhost:8000
Copy the generated _site
directory to the site repo. Rename the Home.html
page as index.html
. Commit the changes and push the repo up to GitHub.To commit the generated web pages, you’ll need repository read+write permission as an organization team member. GitHub will automatically publish the updated site in less than a minute.
$ cp -R _site/* ../railsapps.github.io $ rm -rf _site/ $ cd ../railsapps.github.io $ mv Home.html index.html $ git add . $ git commit -am "update website" $ git push origin master
See the updated site at http://railsapps.github.io.
I looked at Jekyll. It generates static pages from markup but it’s more complex and better suited to publishing a blog.
I looked at Smeagol. It is a server that hosts and renders a Gollum wiki (such as GitHub wiki pages). It requires installation as an app on a hosting site that runs Ruby. It would require maintaining a server and would not allow the site to be hosted on a GitHub subdomain.
Improvements or corrections to the web site? You can edit the wiki pages directly.
Daniel Kehoe (http://danielkehoe.com/) maintains the website.
You are welcome to contribute.
Copyright © 2012 Daniel Kehoe