index.js
function () {
    // render stylesheets
    var precss = fs.readFileSync(__dirname + '/themes/default/styl/default.styl', 'utf8');
    stylus.render(precss, { filename: 'default.css' }, function(err, css){
      if (err) {
        throw err;
      }

      this.styles = css;
    }.bind(this));

    // collect client js (to be inined later)
    this.js = fs.readFileSync(__dirname + '/themes/default/js/default.js', 'utf8');

    // register handlebars helpers
    Handlebars.registerHelper('roundNumber', function (number) {
      return Math.round(number * Math.pow(10, 2)) / Math.pow(10, 2);
    });

    // collect & compile templates
    this.templates = {};
    this.templates.test = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/test.hbs', 'utf8'));
    this.templates.wrapper = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/wrapper.hbs', 'utf8'));
    this.templates.testresult = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/tests.hbs', 'utf8'));
    this.templates.banner = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/banner.hbs', 'utf8'));
    this.templates.detail = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/detail.hbs', 'utf8'));

    return this;
  }
function () {
    // render stylesheets
    var precss = fs.readFileSync(__dirname + '/themes/default/styl/default.styl', 'utf8');
    stylus.render(precss, { filename: 'default.css' }, function(err, css){
      if (err) {
        throw err;
      }

      this.styles = css;
    }.bind(this));

    // collect client js (to be inined later)
    this.js = fs.readFileSync(__dirname + '/themes/default/js/default.js', 'utf8');

    // register handlebars helpers
    Handlebars.registerHelper('roundNumber', function (number) {
      return Math.round(number * Math.pow(10, 2)) / Math.pow(10, 2);
    });

    // collect & compile templates
    this.templates = {};
    this.templates.test = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/test.hbs', 'utf8'));
    this.templates.wrapper = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/wrapper.hbs', 'utf8'));
    this.templates.testresult = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/tests.hbs', 'utf8'));
    this.templates.banner = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/banner.hbs', 'utf8'));
    this.templates.detail = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/detail.hbs', 'utf8'));

    return this;
  }
function ( ) { // render stylesheets var precss = fs . readFileSync ( __dirname + '/themes/default/styl/default.styl' , 'utf8' ) ; stylus . render ( precss , { filename : 'default.css' } , function ( err , css ) { if ( err ) { throw err ; } this . styles = css ; } . bind ( this ) ) ; // collect client js (to be inined later) this . js = fs . readFileSync ( __dirname + '/themes/default/js/default.js' , 'utf8' ) ; // register handlebars helpers Handlebars . registerHelper ( 'roundNumber' , function ( number ) { return Math . round ( number * Math . pow ( 10 , 2 ) ) / Math . pow ( 10 , 2 ) ; } ) ; // collect & compile templates this . templates = { } ; this . templates . test = Handlebars . compile ( fs . readFileSync ( __dirname + '/themes/default/hbs/test.hbs' , 'utf8' ) ) ; this . templates . wrapper = Handlebars . compile ( fs . readFileSync ( __dirname + '/themes/default/hbs/wrapper.hbs' , 'utf8' ) ) ; this . templates . testresult = Handlebars . compile ( fs . readFileSync ( __dirname + '/themes/default/hbs/tests.hbs' , 'utf8' ) ) ; this . templates . banner = Handlebars . compile ( fs . readFileSync ( __dirname + '/themes/default/hbs/banner.hbs' , 'utf8' ) ) ; this . templates . detail = Handlebars . compile ( fs . readFileSync ( __dirname + '/themes/default/hbs/detail.hbs' , 'utf8' ) ) ; return this ; }
Loads and prepares all the templates for
CSS, JS & HTML

@method loadTemplates
@chainable
Loads and prepares all the templates for CSS JS & HTML