Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daggerok/spring-boot-thymeleaf-layouts

This repository contains example of using thymeleaf layouts (nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect) In addition here also demonstrated webflux interceptor (WebFilter)
https://github.com/daggerok/spring-boot-thymeleaf-layouts

filter-interceptor interceptor layout layouts spring-boot spring-boot-2 thymeleaf thymeleaf-layout thymeleaf-layouts webflux webflux-filter-interceptor webflux-interceptor

Last synced: 3 days ago
JSON representation

This repository contains example of using thymeleaf layouts (nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect) In addition here also demonstrated webflux interceptor (WebFilter)

Awesome Lists containing this project

README

        

= spring-boot-thymeleaf-layouts image:https://travis-ci.org/daggerok/spring-boot-thymeleaf-layouts.svg?branch=master["Build Status", link="https://travis-ci.org/daggerok/spring-boot-thymeleaf-layouts"]

//tag::content[]
This repository contains example of using thymeleaf layouts (`nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect`)
In addition here also demonstrated webflux interceptor (WebFilter)

HOW TO:

* add dialect dependency

* add java configuration

[source,kotlin]
----
@Configuration
class ThymeleafLayoutConfig {
@Bean fun layoutDialect() = LayoutDialect()
}
----

* add common layout `src/main/resources/templates/layouts/default.html`

[source,xml]
----

Common title


Common layout fragment

App footer

Common app footer

----

* add views `src/main/resources/templates/index.html` or `src/main/resources/templates/info.html`
with proper declaration: ``

[source,html]
----

title per view


Info header h3


section content per view

footer content per view

----

== build / run

.gradle
[source,bash]
----
./gradlew
java -jar build/libs/*.jar
bash build/libs/*.jar

./gradlew build composeUp
./gradlew composeDown
----

.maven
[source,bash]
----
./mvnw
java -jar target/*.jar
bash target/*.jar

./mvnw; ./mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:up
./mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:down
----

links:

- link:https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#template-layout[Thymeleaf 3 is natively supports layouts]
- link:https://ultraq.github.io/thymeleaf-layout-dialect/Examples.html#layouts[Thymeleaf layouts docs]
- link:https://github.com/ultraq/thymeleaf-layout-dialect[Github: ultraq/thymeleaf-layout-dialect]

generated by link:https://github.com/daggerok/generator-jvm/[jvm] yeoman generator
//end::content[]