FOSS4G2009 Website Update

From OSGeo
Jump to navigation Jump to search

How To Update FOSS4G 2009 Website

How Is FOSS4G 2009 Website Built?

FOSS4G 2009 website is built using the http://staticmatic.rubyforge.org/ web framework.

New to Staticmatic?

If you are new to staticmatic then you will need to put on your inquisitive-nerd-hat for an hour or two and learn the concepts behind it. And like any nerdy-kitten-cuteness staticmatic will leave you feeling warm and fuzzy after an hour or two. Oh the joys of using staticmatic: http://staticmatic.rubyforge.org/how_to_use.html

Prerequisits

  1. You need to install Ruby. New to ruby? Don't fret download one-click installer for your OS from here: http://www.ruby-lang.org/en/downloads/
  2. Then install staticmatic http://staticmatic.rubyforge.org/download.html
  3. Get the source code for the http://2009.foss4g.org/ website from https://svn.osgeo.org/osgeo/foss4g/2009/website/foss4g09_staticmatic/ You will need your OSGeo (http://osgeo.org/) login/password to commit stuff.
  4. Editor - you can use any editor for editing haml but you ideally want something with syntax highlighting


Understanding the Website Source code

The FOSS4G 2009 website's html is generated by templates written using staticmatics. This means that we can write haml template instead of html, write ruby helpers to generate html code and create partials and layouts for a more modular website while keeping to the good programing philosophy of DRY (Don't Repeat Yourself). So the current source directories are:

+-src/
  |
  +-helpers/
  |
  +-layouts/
  |
  +-pages/
  |
  +-partials/
  |
  +-stylesheets/

pages

This directory contains the haml template for the main pages of the http://2009.foss4g.org website. say for example that you want to go change the main index page. This would require you to edit the src/pages/index.haml page. Notice that the page only contains the content of the mainContent div. This is because staticmatic automatically creates the surrounding layout from the src/layouts/application.haml