var express = require('express'),
    exphbs  = require('express3-handlebars'),
    path    = require('path'),

    config     = require('./config'),
    hbs        = require('./lib/hbs'),
    middleware = require('./lib/middleware'),
    routes     = require('./lib/routes'),

    app = express();

// -- Config -------------------------------------------------------------------

app.set('name', 'YUI CSS');
app.set('env', config.env);
app.set('port', config.port);
app.enable('strict routing');

app.engine(hbs.extname, hbs.engine);
app.set('view engine', hbs.extname);
app.set('views', config.dirs.views);

app.locals({
    title         : 'YUI CSS',
    copyright_year: '2013',

    nav: [
        {id: 'home',   url: '/',        label: 'Home'},
        {id: 'base',   url: '/base/',   label: 'Base'},
        {id: 'grids',  url: '/grids/',  label: 'Grids'},
        {id: 'layouts',url: '/layouts/',label: 'Layouts'},
        {id: 'forms',  url: '/forms/',  label: 'Forms'},
        {id: 'tables', url: '/tables/', label: 'Tables'},
        {id: 'lists',  url: '/lists/',  label: 'Navigation'}
    ],

    yui    : config.yui,
    min    : config.isProduction ? '-min' : '',
    typekit: config.typekit
});

// -- Middleware ---------------------------------------------------------------

if (config.isDevelopment) {
    app.use(express.logger('tiny'));
}

app.use(express.compress());
app.use(express.favicon(path.join(config.dirs.pub, 'favicon.ico')));
app.use(app.router);
app.use(middleware.slash);
app.use(express.static(config.dirs.pub));
app.use(middleware.errors.notfound);

if (config.isDevelopment) {
    app.use(express.errorHandler({
        dumpExceptions: true,
        showStack     : true
    }));
} else {
    app.use(middleware.errors.server);
}

// -- Routes -------------------------------------------------------------------

app.get('/',        routes.render('home'));
app.get('/base/',   routes.render('base'));
app.get('/grids/',  routes.render('grids'));
app.get('/layouts/',routes.render('layouts'));
app.get('/forms/',  routes.render('forms'));
app.get('/tables/', routes.render('tables'));
app.get('/lists/',  routes.render('lists'));

app.get('/layouts/marketing/', routes.render('templates/marketing', {layout: 'blank'}));
app.get('/layouts/gallery/', routes.render('templates/gallery', {layout: 'blank'}));


// -- Exports ------------------------------------------------------------------

module.exports = app;

@@ -707,24 +707,25 @@
 : 'home',   
+ 
 url: '/',   
@@ -717,24 +717,25 @@
    url: '/',
+ 
         labe
@@ -769,16 +769,17 @@
 ase',   
+ 
 url: '/b
@@ -784,16 +784,17 @@
 /base/',
+ 
    label
@@ -823,24 +823,25 @@
 : 'grids',  
+ 
 url: '/grids
@@ -839,24 +839,25 @@
 : '/grids/',
+ 
   label: 'Gr
@@ -886,16 +886,17 @@
 ayouts',
+ 
 url: '/l
@@ -904,16 +904,17 @@
 youts/',
+ 
 label: '
@@ -945,16 +945,17 @@
 'forms',
+ 
   url: '
@@ -961,24 +961,25 @@
 '/forms/',  
+ 
 label: 'Form
@@ -1005,16 +1005,17 @@
 tables',
+ 
  url: '/
@@ -1019,24 +1019,25 @@
  '/tables/',
+ 
  label: 'Tab
@@ -1062,24 +1062,25 @@
 : 'lists',  
+ 
 url: '/lists
@@ -1078,24 +1078,25 @@
 : '/lists/',
+ 
   label: 'Na
@@ -1876,24 +1876,25 @@
 '/',        
+ 
 routes.rende
@@ -1922,16 +1922,17 @@
 /base/',
+ 
    route
@@ -1966,24 +1966,25 @@
 '/grids/',  
+ 
 routes.rende
@@ -2016,16 +2016,17 @@
 youts/',
+ 
 routes.r
@@ -2060,24 +2060,25 @@
 '/forms/',  
+ 
 routes.rende
@@ -2105,24 +2105,25 @@
 ('/tables/',
+ 
  routes.rend
@@ -2151,24 +2151,25 @@
 t('/lists/',
+ 
   routes.ren

add spaces