Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated docs for deprecated "include" statement #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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