Permalink
Browse files

add layout example

  • Loading branch information...
1 parent 2a1aca8 commit 54ba8e5a5512353f4d9b10b3f1714f00b490b3c7 @tj committed Oct 3, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 Readme.md
View
@@ -1,4 +1,3 @@
-[![build status](https://secure.travis-ci.org/visionmedia/ejs.png)](http://travis-ci.org/visionmedia/ejs)
# EJS
@@ -141,6 +140,19 @@ ejs.filters.last = function(obj) {
};
```
+## Layouts
+
+ Currently EJS has no notion of blocks, only compile-time `include`s,
+ however you may still utilize this feature to implement "layouts" by
+ simply including a header and footer like so:
+
+```html
+<% include head %>
+<h1>Title</h1>
+<p>My page</p>
+<% include foot %>
+```
+
## client-side support
include `./ejs.js` or `./ejs.min.js` and `require("ejs").compile(str)`.

0 comments on commit 54ba8e5

Please sign in to comment.