0.13.0 ā€¢ Published 6 years ago

uiengine-adapter-html v0.13.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

UIengine template adapter for HTML

šŸš¦ State: Production ready

Configuration

Plain and simple:

adapters:
  html: uiengine-adapter-html

With options:

adapters:
  html:
    module: uiengine-adapter-html
    options:
      basedir: ./src/components
      debug: true

The basedir option allows for referencing includes with an absolute path.

In addition to that there is the option debug for a more detailed output in case of rendering errors.

Variables

You can reference variables with the JavaScript template literal syntax:

<div>${myData.variable}</div>

Given the context { myData: { variable: 'Test' } } this would render like

<div>Test</div>

Includes

You can include other html templates/components using the SSI include command:

<body>
  <!--#include file="header.html" -->
  <div>main content</div>
  <!--#include file="footer.html" -->
</body>

Variables and includes can also be combined:

<body>
  <!--#include file="${myIncludeFile}" -->
</body>