Skip to content

Commit 18e3c15

Browse files
committed
Merge branch 'master' of github.com:modularcode/modular-admin-html
2 parents e85bd87 + a307268 commit 18e3c15

1 file changed

Lines changed: 66 additions & 4 deletions

File tree

README.md

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# Modular Admin: Free Bootstrap4 Dashboard Theme <br/> HTML version
1+
# Modular Admin: Free Bootstrap4 Dashboard Theme <br/> HTML version
22

33
<a href="http://modularcode.github.io/modular-admin-html/" target="_blank">
44
![demo](http://modularcode.github.io/modular-admin-html/assets/demo.png)
55
</a>
66

7+
<a href="http://modularcode.github.io/modular-admin-html/" target="_blank">
8+
![HTML5 jQuery Bootstrap4 SASS Handlebars Gulp Bower](http://modularcode.github.io/modular-admin-html/assets/features.png)
9+
</a>
10+
711
<p align="center">
812
<strong>
913
<a href="http://modularcode.github.io/modular-admin-html/" target="_blank">View Demo</a> | <a href="https://github.com/modularcode/modular-admin-html/archive/master.zip" target="_blank">Download ZIP</a>
@@ -13,6 +17,14 @@
1317
built in modular way. That makes it awesomely easy to scale, modify and maintain.
1418
### Main features
1519

20+
* HTML5 + CSS3 with FlexBox
21+
* jQuery
22+
* Bootstrap4
23+
* SASS
24+
* Hanldebars with layouts
25+
* Gulp
26+
* Bower
27+
1628
### Other versions
1729

1830
This is the HTML version, which is great for enhancing and integrating it into other platforms and environments.
@@ -149,7 +161,7 @@ In this folder are located files related to our application building. That can b
149161
Compiled state of our app with processed styles, templates, scripts and assets.
150162

151163
**Warning! Never work inside this folder, because your changes would be overwritten on every build**
152-
164+
pu
153165

154166
## File Types
155167

@@ -159,7 +171,7 @@ Our app consists of different file types.
159171

160172
We use [SASS](http://sass-lang.com/) as CSS preprocessor language.
161173
Main variables are defined in ```src/_variables.scss``` folder.
162-
For making life easier we broke down styles into components, and on build we're just merging all ```.scss``` files together and processing it to ```pubilc/css/app.css``` file. Style files are merged in following order
174+
For making life easier we broke down styles into components, and on build we're just merging all ```.scss``` files together and processing it to ```dist/css/app.css``` file. Style files are merged in following order
163175

164176
```
165177
{variables.scss}
@@ -173,13 +185,63 @@ There are also different theme variations located in ```src/_themes/``` folder,
173185

174186
#### Scripts (*.js)
175187

188+
We separate application's scripts across it's components. For simplicity we use ES5 in this version and just wrap each component's script in jQuery ```$(function() { })```. JS configurations are defined in ```src/config.js``` file. On build application script files are merged together and copied to ```dist/js/app.js``` fole. Script files are merged in following order
189+
190+
```
191+
{config.js}
192+
{all .js files except main.js}
193+
{main.js}
194+
```
195+
176196
#### Templates (*.hbs)
177197

198+
Templates are pieces of HTML files written in template engine language. We use [Handlebars](http://handlebarsjs.com/), which allows to have conditions in HTML, reuse partials in different pages (e.g. sidebars, footers), use loops, layouts etc.
199+
178200
#### Pages (*-page.hbs)
179201

202+
Templates themselves are just parts of markup, and aren't compiled as separate files. What we really want in final output is ```.html``` page in ```dist/``` folder. For that reason there are special handlebar templates which filenames end with ```-page.hbs```. Each ```{pagename}-page.hbs``` file would be compiled to ```dist/{pagename}.html``` page with flatened file structure.
203+
204+
Pages can consist of different templates (partials) which can be included thanks to handlebars partial including. Also each page have it's context which is data passed into template on rendering. That data is used in template expressions and variables. page contexts can be defined in two ways:
205+
206+
**YAML** headers ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/app/dashboard/index-page.hbs))
207+
208+
```
209+
---
210+
foo: bar
211+
list:
212+
- One
213+
- Two
214+
- Three
215+
---
216+
```
217+
and **_context.js** files ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/_context.js)).
218+
```
219+
module.exports = {
220+
foo: 'bar',
221+
foo2: function() {
222+
// do some magic, return some string
223+
},
224+
list: [
225+
'One', 'Two', 'Three'
226+
]
227+
}
228+
```
229+
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+
180232
#### Layouts (*-layout.hbs)
181233

182-
#### Contexts (_context.js)
234+
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+
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+
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+
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.
241+
242+
#### Vendor files
243+
244+
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.
183245

184246
## Build Tasks
185247

0 commit comments

Comments
 (0)