In-browser version of the Thymeleaf Layout Dialect, used for static prototyping
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.babelrc
.eslintrc.json
.gitignore
.nycrc
.travis.yml
CHANGELOG.md
LICENSE.txt
README.md
bower.json
package.json
rollup.config.js
thymeleaf-layout-dialect.js
thymeleaf-layout-dialect.min.js

README.md

Thymeleaf Layout Dialect JS

Build Status Coverage Status Bower GitHub Release License

In-browser version of the Thymeleaf Layout Dialect, used for static prototyping.

Installation

A browser that supports the fetch API and a large chunk of the ES6 spec is currently required.

Many front-end development projects these days use a mock server for rapid development of static assets, eg: webpack dev server, or Express.js. This project currently works using those mock servers as you can't retrieve other resources (ie: your layout templates) using the file:// protocol.

Bower

This project is available via Bower and can be installed with the following command from a directory within your own project:

bower install thymeleaf-layout-dialect --save-dev

Usage

With those in place, add the following script line somewhere in your template, preferably the <head> section:

<script src="(path-to-thymeleaf-layout-dialect-js)/thymeleaf-layout-dialect.js" th:remove="all"></script>

The th:remove directive is there so that when your template is processed for real by your app server, Thymeleaf will remove this line.