Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
aseemk committed Apr 19, 2011
1 parent 3fef2b2 commit 341f456
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
18 changes: 18 additions & 0 deletions app.js
@@ -0,0 +1,18 @@
var express = require('express');
var app = express.createServer();

app.configure(function () {
app.use(require('./blocks'));
app.use(app.router);
});

app.set('views', __dirname + '/views');
app.set('view engine', 'html');
app.register('.html', require('ejs'));

app.get('/', function (req, res) {
res.render('test', { foo: 'bar' });
});

app.listen(8080);
console.log('listening on port 8080...');
2 changes: 2 additions & 0 deletions layout_main.ejs → layout_main.html
Expand Up @@ -14,3 +14,5 @@ <h1>Main Layout</h1>
<ul><li>A layout.css stylesheet in the document head</li>
<li>A layout.js script at the document foot</li>
</ul>

<%- body %>
4 changes: 3 additions & 1 deletion layout_site.ejs → layout_site.html
Expand Up @@ -15,8 +15,10 @@ <h1>Site Layout</h1>
<ul><li><t>head</t>: a block whose content is rendered in the HTML 'head' section</li>
<li><t>foot</t>: a block whose content is rendered just before the closing 'body' tag</li>
</ul>

<%- body %>

<!-- pull in the 'foot' block content defined by our child layouts/pages -->
<%- block('foot') %>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion index.ejs → test.html
Expand Up @@ -13,4 +13,4 @@ <h2>Index Page</h2>
</p>
<ul><li>A page.css stylesheet in the document head</li>
<li>A page.js script at the document foot</li>
</ul>
</ul>

0 comments on commit 341f456

Please sign in to comment.