Skip to content

Commit

Permalink
Add more docs on a layout's {{{body}}}.
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
ericf committed Feb 1, 2013
1 parent 7e4c7b9 commit 49ddc17
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ app's views. This makes it trivial to use this module in basic apps:

#### app.js:

Creates a super simple Express app which shows the basic way to register a
Handlebars view engine using this module.

```javascript
var express = require('express'),
exphbs = require('express3-handlebars'),
Expand All @@ -118,6 +121,10 @@ app.listen(3000);

#### views/layouts/main.handlebars:

The main layout is the HTML page wrapper which can be reused for the different
views of the app. `{{{body}}}` is used as a placeholder for where the main
content should be rendered.

```html
<!doctype html>
<html>
Expand All @@ -135,6 +142,9 @@ app.listen(3000);

#### views/home.handlebars:

The content for the app's home view which will be rendered into the layout's
`{{{body}}}`.

```html
<h1>Example App: Home</h1>
```
Expand Down Expand Up @@ -180,6 +190,9 @@ control over caching when calling these methods directly.

### Layouts

A layout is simply a Handlebars template with a `{{{body}}}` placeholder.
Usually it will be an HTML page wrapper in which views will be rendered.

This module adds back the concept of "layout", which was removed in Express 3.x.
This view engine can be configured with a path to the layouts directory, by
default it's set to `"views/layouts/"`.
Expand Down

0 comments on commit 49ddc17

Please sign in to comment.