Q:

Set CSS path for Jade layouts

I'd like to set my CSS path in my express application in order to use this one in my jade layouts. However, I don't know how to do, I try to use "app.set('cssPath', __dirname+'/public/admin/css/')" but it doesn't work because I can not use "app.get()" in my external controllers.
My layout _layout.jade :
!!! 5
html(lang='fr')
  head
    meta(charset='UTF-8')
    link(href='admin/css/screen.css', media='screen, projection', rel='stylesheet', type='text/css')
  body
    .container
      h1 Wellcome to Forest Administrator
      .space20
      block content
      .clear.space20
  script(type='text/javascript', src='admin/js/jquery.js')

My page edit.jade :
extends ../_layout

block content
  .block.half.first
    h2 Add a post

And I'd like to use something like :
link(href='+myCssPath+', media='screen, projection', rel='stylesheet', type='text/css')

A:

Not sure if I get what you want to do but You can use 
res.locals.cssPath = 'string with the path';

And cssPath will be available in your template.
Besides that you don't need  __dirname+'/public/.  Part because when the page is rendered for the browser /public/ will be /
[edit]  If you want to have that variable available in all you routes, but declaring it just once, you can create a small middleware like  
var express = require('express');
var app = express();
var app.configure(function(){

    app.use(express.bodyParser());
    app.use(express.methodOverride());
    // .. and your other tipical configuration

    //this small middleware for variables that must available in all paths
     app.use(function(req, res, next) {
        res.locals.cssPath = 'path to the css directory';
        next();
    });
});
//From here your typical route declarations  
app.get('/', function(req, res) { res.render('someView'); });

