# thymeleaf-layout-dialect **Repository Path**: ljcyu/thymeleaf-layout-dialect ## Basic Information - **Project Name**: thymeleaf-layout-dialect - **Description**: A dialect for Thymeleaf that lets you build layouts and reusable templates in order to improve code reuse - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-05 - **Last Updated**: 2021-10-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Thymeleaf Layout Dialect ======================== [![Build Status](https://github.com/ultraq/thymeleaf-layout-dialect/actions/workflows/build.yml/badge.svg)](https://github.com/ultraq/thymeleaf-layout-dialect/actions) [![Coverage Status](https://coveralls.io/repos/github/ultraq/thymeleaf-layout-dialect/badge.svg?branch=main)](https://coveralls.io/github/ultraq/thymeleaf-layout-dialect?branch=main) [![Maven Central](https://img.shields.io/maven-central/v/nz.net.ultraq.thymeleaf/thymeleaf-layout-dialect.svg?maxAge=3600)](http://search.maven.org/#search|ga|1|g%3A%22nz.net.ultraq.thymeleaf%22%20AND%20a%3A%22thymeleaf-layout-dialect%22) A dialect for Thymeleaf that lets you build layouts and reusable templates in order to improve code reuse. Documentation ------------- All of the latest documentation on the layout dialect can be found on the dedicated docs website at https://ultraq.github.io/thymeleaf-layout-dialect/ For version 1 docs which supported Thymeleaf 2, the classic readme still exists over on https://github.com/ultraq/thymeleaf-layout-dialect/tree/1.4.0 What does it do? ---------------- The Thymeleaf Layout Dialect adds the ability to decorate templates - automatically for the `` section of an HTML template, and explicitly through extension points that developers can add to their templates. This all adds up to create layouts that can be extended in a manner similar to classical inheritence. For example, given a common `layout.html` file, set some shared static assets in the `` and define extension points in the body with the `layout:fragment` processor: ```html Layout page

My website

Page content goes here

``` Create a content template that will define its own title, static resources, and replacements for those extension points. Link the page to the layout by using the `layout:decorate` processor at the root element of the page which will instruct Thymeleaf to decorate the layout with this template: ```html Content page

This is a paragraph from the content page

``` When Thymeleaf processes your content template, the resulting HTML will be: ```html Content page

My website

This is a paragraph from the content page

``` Learn more ---------- Check out the [getting started](https://ultraq.github.io/thymeleaf-layout-dialect/getting-started/) guide to learn how to add the layout dialect to your Thymeleaf project, or read up on the many [processors](https://ultraq.github.io/thymeleaf-layout-dialect/processors/) for more ways of how the layout dialect can help you build your templates.