Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ File issues for EJS v2 here: https://github.com/mde/ejs/issues

## Includes

Includes are relative to the template with the `include` statement,
Includes are relative to the template with the `include()` function,
for example if you have "./views/users.ejs" and "./views/user/show.ejs"
you would use `<% include user/show %>`. The included file(s) are literally
you would use `<%- include("user/show") %>`. The included file(s) are literally
included into the template, _no_ IO is performed after compilation, thus
local variables are available to these included templates.

```
<ul>
<% users.forEach(function(user){ %>
<% include user/show %>
<%- include ("user/show") %>
<% }) %>
</ul>
```
Expand Down Expand Up @@ -160,10 +160,10 @@ ejs.filters.last = function(obj) {
simply including a header and footer like so:

```html
<% include head %>
<%- include("head") %>
<h1>Title</h1>
<p>My page</p>
<% include foot %>
<%- include("foot") %>
```

## client-side support
Expand Down