Skip to content
Myr

Merge pull request #1176 from nullfirm/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

add hogan.js template engine for express@3.0

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parents f25aaf1, 0a874ad · Browse files · 2 files+23 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+23 added−0 removed

  • other:+23 added−0 removed

2 files+23 added−0 removed

modified:bin/express+22 added
17 unmodified lines
18 .version(version)19 .option('-s, --sessions', 'add session support')20 .option('-e, --ejs', 'add ejs engine support (defaults to jade)')21 .option('-J, --jshtml', 'add jshtml engine support (defaults to jade)')22 .option('-h, --hjs', 'add hogan.js engine support')23 .option('-c, --css <engine>', 'add stylesheet <engine> support (less|stylus) (defaults to plain css)')24 .option('-f, --force', 'force on non-empty directory')25 .parse(process.argv);26
9 unmodified lines
3637program.template = 'jade';38if (program.ejs) program.template = 'ejs';39if (program.jshtml) program.template = 'jshtml';40if (program.hjs) program.template = 'hjs';4142/**43 * Routes index template.44 */
79 unmodified lines
124 , '<p>Welcome to @write(title)</p>'125].join(eol);126127/**128 * Hogan.js index template.129 */130var hjsIndex = [131 '<!DOCTYPE html>'132 , '<html>'133 , ' <head>'134 , ' <title>{{ title }}</title>'135 , ' <link rel=\'stylesheet\' href=\'/stylesheets/style.css\' />'136 , ' </head>'137 , ' <body>'138 , ' <h1>{{ title }}</h1>'139 , ' <p>Welcome to {{ title }}</p>'140 , ' </body>'141 , '</html>'142].join(eol);143144/**145 * Default css template.146 */147148var css = [
144 unmodified lines
293 case 'jshtml':294 write(path + '/views/layout.jshtml', jshtmlLayout);295 write(path + '/views/index.jshtml', jshtmlIndex);296 break;297 case 'hjs':298 write(path + '/views/index.hjs', hjsIndex);299 break;300301 }302 });303
100 unmodified lines
modified:package.json+1 added