You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -161,8 +162,8 @@ In this folder are located files related to our application building. That can b
161
162
Compiled state of our app with processed styles, templates, scripts and assets.
162
163
163
164
**Warning! Never work inside this folder, because your changes would be overwritten on every build**
164
-
pu
165
165
166
+
<br>
166
167
## File Types
167
168
168
169
Our app consists of different file types.
@@ -214,7 +215,7 @@ list:
214
215
- Three
215
216
---
216
217
```
217
-
and **_context.js** files ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/_context.js)).
218
+
and **_context.js** files.
218
219
```
219
220
module.exports = {
220
221
foo: 'bar',
@@ -227,32 +228,45 @@ module.exports = {
227
228
}
228
229
```
229
230
230
-
The final result of page context is compination of both ways. Moreover, different depth level _context.js files are extending each other and then are extended with YAML headers data. In our case we have ```src/_context.js``` file, where main website properties are defined and YAML headers in ```*-page.hbs``` files.
231
+
The final result of page context is compination of both ways. Moreover, different depth level _context.js files are extending each other and then are extended with YAML headers data. For simplicity we use only **YAML** headers.
231
232
232
233
#### Layouts (*-layout.hbs)
233
234
234
235
If different pages have lot of common components like sidebar, header, footer, It's a good idea to define a layout for those common pages and define in page files only the content which is unique.
235
236
236
237
Layout is a page content wrapper. If the page has layout in output we'll get page's content inserted into layout. Layouts should have ```{{{body}}}``` handlebars tag, which is entry point for page content. ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/app/app-layout.hbs))
237
238
238
-
To define a page layout you need to specify page file context's ```layout``` variable. It can be done both by YAML header or _context.js file. ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/app/forms/forms-page.hbs))
239
+
To define a page layout you need to specify page file context's ```layout``` variable. It can be done both by YAML header or _context.js file. ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/app/forms/forms-page.hbs)).
240
+
241
+
Layouts can also have contexts and parent layouts.
239
242
240
-
If you need more advanced layouting you can use [handlebar-layouts](https://www.npmjs.com/package/handlebars-layouts) helper approach, which is also available out of the box.
243
+
```
244
+
{_main-layout.hbs} # main layout with doctype, head, scripts declaration
245
+
{app/app-layout.hbs} # dashboard layout with sidebar, header and footer
246
+
{app/forms/forms-page.hbs} # any dashboard page
247
+
```
248
+
249
+
250
+
If you need more advanced layouting with multiple content blocks at the same time you can use [handlebar-layouts](https://www.npmjs.com/package/handlebars-layouts) helper approach, which is also available out of the box.
241
251
242
252
#### Vendor files
243
253
244
254
Except application files there are also third party plugin files (e.g. Bootstrap). They are managed by using [Bower](http://bower.io/). Usually vendor libraries consist from scripts, styles and assets (images, fonts). The build system will concatenate and copy all script and style files correspondingally to ```dist/js/vendor.js```and ```dist/css/vendor.css``` also will copy all assets to ```dist/assets/``` folder.
245
255
256
+
<br>
246
257
## Build Tasks
247
258
248
-
259
+
<br>
249
260
## Get in touch
250
261
251
-
Usually we're discussing stuff [ModularCode Facebook Group](https://www.facebook.com/groups/710770032358423/).
262
+
Usually we're discussing stuff in [ModularCode Facebook Group](https://www.facebook.com/groups/710770032358423/).
252
263
Feel free to reach us for any questions, sugestions, remarks and potential feature requests.
0 commit comments