In-browser version of the Thymeleaf Layout Dialect, used for static prototyping.
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.
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
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.