It may be natively supported by your framework of choice or may be an external library.
For example PHP Smarty or Ruby's ERB are such template engines.
The main purpose of using a template system is to separate presentation from application logic
You can also click on each file name provided in the following sections and view its content inside your browser.
mustache/app/views/layouts/default.mustache
As you can see it contains some HTML code and some special tags (Mustache tags).
There are 6 kinds of Mustache tags used here:
{{page.title}}
or {{site.title}}
>
such as {{> layout.sidebar}}
.
The engine tries to load current layout's sidebar
template file.
mustache/app/views/layouts/partials/default
mustache/app/views/layouts/partials/_shared
In our case, sidebar's HTML code is shared between default & empty layouts.
So it's located at:
mustache/app/views/layouts/partials/_shared/sidebar.mustache
mustache/app/views/layouts/partials/_shared/sidebar.mustache
there is:
<div id="sidebar" class="sidebar {{#page.horizontal-menu}} h-sidebar{{/page.horizontal-menu}}The
h-sidebar
class will be printed only if a page.horizontal-menu
variable is defined and is not false or null.
sidebar
mustache file we have: {{^page.side_menu_collapsible}} {{^page.responsive_style_2}} responsive {{/page.responsive_style_2}} {{/page.side_menu_collapsible}}The
responsive
class will be printed
only if page.side_menu_collapsible
and page.responsive_style_2
variables are NOT defined or are false/null.
{{#conversation_list}} <h3>{{title}}</h3> <div class="content">{{content}}</div> <div class="time">{{time}}</div> {{/conversation_list}}
{{! This is a comment}}
. These are ignored and won't be converted to HTML comments.
site.*
for example site.title
layout.*
for example layout.sidebar_items
page.*
for example page.title
or page.content
path.assets
, etc.
site.remote_jquery
inside
mustache/app/views/layouts/partials/_shared/_template/jquery.mustache
is an option that specifies whether we should
use remote (CDN) jquery files or not when generating our HTML output.
Following Data Files
section describes where data is loaded from.
mustache/app/views/layouts
folder which includes:
mustache/app/views/layouts/default.mustache
mustache/app/views/layouts/login.mustache
mustache/app/views/layouts/empty.mustache
mustache/app/views/layouts/partials
folder.
mustache/app/views/layouts/partials/_shared/sidebar.mustache
mustache/app/views/layouts/partials/_shared/sidebar/item.mustache
mustache/app/views/layouts/partials/_shared/sidebar/shortcuts.mustache
mustache/app/views/layouts/partials/_shared/navbar.mustache
mustache/app/views/layouts/partials/_shared/navbar/topmenu.mustache
mustache/app/views/layouts/partials/_shared/navbar/toggle_buttons.mustache
mustache/app/views/layouts/partials/_shared/navbar/messages.mustache
mustache/app/views/layouts/partials/_shared/navbar/notifications.mustache
mustache/app/views/layouts/partials/_shared/navbar/tasks.mustache
mustache/app/views/layouts/partials/_shared/navbar/tabbed_user_notifications.mustache
mustache/app/views/layouts/partials/default/navbar/user_menu.mustache
mustache/app/views/layouts/partials/empty/navbar/user_menu.mustache
mustache/app/views/layouts/partials/_shared/settings.mustache
mustache/app/views/layouts/partials/default/breadcrumbs.mustache
mustache/app/views/layouts/partials/default/footer.mustache
mustache/app/views/layouts/partials/_shared/_template/jquery.mustache
mustache/app/views/layouts/partials/_shared/_template/bootstrap.mustache
mustache/app/views/layouts/partials/_shared/_template/fonts.mustache
mustache/app/views/layouts/partials/_shared/_template/fontawesome.mustache
mustache/app/views/layouts/partials/_shared/_template/scripts.mustache
mustache/app/views/layouts/partials/_shared/_template/styles.mustache
mustache/app/views/pages
.
mustache/app/views/pages/index.mustache
mustache/app/views/pages/partials/index/conversations.mustache
mustache/app/views/pages/partials/index/comments.mustache
mustache/app/views/pages/partials/index/tasks.mustache
mustache/app/views/pages/partials/index/members.mustache
mustache/app/views/pages/partials/index/domains.mustache
mustache/app/views/pages/partials/index/infobox.mustache
mustache/app/views/pages/login.mustache
mustache/app/views/pages/partials/login/login_box.mustache
mustache/app/views/pages/partials/login/forgot_box.mustache
mustache/app/views/pages/partials/login/signup_box.mustache
mustache/app/views/pages
.
mustache/app/views/assets
.
mustache/app/views/assets/scripts
.
mustache/app/views/assets/scripts/index.js
mustache/app/views/assets/scripts/tables.js
mustache/app/views/assets/scripts/profile.js
mustache/app/views/assets/styles/elements.css
mustache/app/views/assets/styles/grid.css
mustache/app/data
mustache/app/data/layouts
folder.
mustache/app/data/layouts/partials/default/navbar_messages.json
mustache/app/data/layouts/partials/default/navbar_notifications.json
mustache/app/data/layouts/partials/default/navbar_tasks.json
mustache/app/data/layouts/partials/default/sidebar_items.json
mustache/app/data/layouts/partials/empty/sidebar_items.json
mustache/app/data/pages
folder.
mustache/app/data/pages/index.json
mustache/app/data/pages/top-menu.json
top-menu.json
has horizontal-menu
and top-menu
options enabled.
Also each page's partial data is inside mustache/app/data/pages/partials
folder.
mustache/app/data/pages/partials/index/conversations.json
mustache/app/data/pages/partials/profile/activities.json
mustache/app/data/common
folder.
mustache/app/data/common/site.json
mustache/app/data/common/script-mapping.json
mustache/app/data/common/style-mapping.json
mustache/js
directory and rebuild HTML files using the following command:
node index.js
output
folder by default.
There are also a few options you can use:
mustache/app/data/common/site.json
mustache/js/classes/autoload-hogan.js
and
mustache/js/classes/autoload-mustache.js