Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

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>