Doesn't cogear.js offer partials?
joannesalfa opened this issue · comments
Ivan Perez commented
In order to keep the APP for changes we need a way to reuse content. Partial provides a simple interface for great flexibility and power around reusing pieces of the project
In EJS:
<h1>Hello</h1>
<%- partial("_menu") %>
<body>...</body>
Partial directory:
/project/partials/_menu.ejs
Dmitriy Belyaev commented
Hi, @joannesalfa!
Yes, it does in layouts.
You can specify relative path to partial from a layout template.
/themes/default
.
├── README.md
├── layouts
│ ├── index.ejs
│ └── test.ejs
├── package.json
├── resources
│ └── favicon.png
├── screenshot.jpg
├── style.styl
└── theme.js
index.ejs
<!doctype html>
<html class="no-js" lang="">
<head>
<title><%- title %></title>
</head>
<body>
<%- content %>
<%- include test.ejs %>
</body>
</html>
test.ejs
Hello!