Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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)
- Host: GitHub
- URL: https://github.com/daggerok/spring-boot-thymeleaf-layouts
- Owner: daggerok
- License: mit
- Created: 2018-04-29T01:31:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-27T23:31:12.000Z (over 6 years ago)
- Last Synced: 2023-04-05T03:19:12.269Z (over 1 year ago)
- Topics: filter-interceptor, interceptor, layout, layouts, spring-boot, spring-boot-2, thymeleaf, thymeleaf-layout, thymeleaf-layouts, webflux, webflux-filter-interceptor, webflux-interceptor
- Language: HTML
- Homepage:
- Size: 116 KB
- Stars: 2
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
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[]