File tree Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,16 @@ var fortune = require('./lib/fortune.js');
44var app = express ( ) ;
55
66// set up handlebars view engine
7- var handlebars = require ( 'express3-handlebars' )
8- . create ( { defaultLayout :'main' } ) ;
7+ var handlebars = require ( 'express3-handlebars' ) . create ( {
8+ defaultLayout :'main' ,
9+ helpers : {
10+ section : function ( name , options ) {
11+ if ( ! this . _sections ) this . _sections = { } ;
12+ this . _sections [ name ] = options . fn ( this ) ;
13+ return null ;
14+ }
15+ }
16+ } ) ;
917app . engine ( 'handlebars' , handlebars . engine ) ;
1018app . set ( 'view engine' , 'handlebars' ) ;
1119
Original file line number Diff line number Diff line change 55 {{ #if showTests }}
66 <link rel =" stylesheet" href =" /vendor/mocha.css" >
77 {{ /if }}
8- <script src =" //code.jquery.com/jquery-2.0.2.min.js" ></script >
98</head >
109<body >
1110 <header ><img src =" /img/logo.png" alt =" Meadowlark Travel Logo" ></header >
1211 {{{ body }}}
12+
13+ <script src =" //code.jquery.com/jquery-2.1.1.min.js" ></script >
14+ <script >window .jQuery || document .write (' <script src="/vendor/js/jquery-2.1.1.min.js"><\/ script>' )</script >
15+ {{{ _sections.jquery }}}
16+
1317 {{ #if showTests }}
1418 <div id =" mocha" ></div >
1519 <script src =" /vendor/mocha.js" ></script >
Original file line number Diff line number Diff line change @@ -4,8 +4,16 @@ var fortune = require('./lib/fortune.js');
44var app = express ( ) ;
55
66// set up handlebars view engine
7- var handlebars = require ( 'express3-handlebars' )
8- . create ( { defaultLayout :'main' } ) ;
7+ var handlebars = require ( 'express3-handlebars' ) . create ( {
8+ defaultLayout :'main' ,
9+ helpers : {
10+ section : function ( name , options ) {
11+ if ( ! this . _sections ) this . _sections = { } ;
12+ this . _sections [ name ] = options . fn ( this ) ;
13+ return null ;
14+ }
15+ }
16+ } ) ;
917app . engine ( 'handlebars' , handlebars . engine ) ;
1018app . set ( 'view engine' , 'handlebars' ) ;
1119
Original file line number Diff line number Diff line change 1010<body >
1111 <header ><img src =" /img/logo.png" alt =" Meadowlark Travel Logo" ></header >
1212 {{{ body }}}
13+
14+ <script src =" //code.jquery.com/jquery-2.1.1.min.js" ></script >
15+ <script >window .jQuery || document .write (' <script src="/vendor/js/jquery-2.1.1.min.js"><\/ script>' )</script >
16+ {{{ _sections.jquery }}}
17+
1318 {{ #if showTests }}
1419 <div id =" mocha" ></div >
1520 <script src =" /vendor/mocha.js" ></script >
You can’t perform that action at this time.
0 commit comments