{"id":19656279,"url":"https://github.com/daggerok/spring-boot-thymeleaf-layouts","last_synced_at":"2025-04-28T18:32:47.119Z","repository":{"id":45211865,"uuid":"131457046","full_name":"daggerok/spring-boot-thymeleaf-layouts","owner":"daggerok","description":"This repository contains example of using thymeleaf layouts (nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect) In addition here also demonstrated webflux interceptor (WebFilter)","archived":false,"fork":false,"pushed_at":"2018-06-27T23:31:12.000Z","size":119,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T10:23:05.985Z","etag":null,"topics":["filter-interceptor","interceptor","layout","layouts","spring-boot","spring-boot-2","thymeleaf","thymeleaf-layout","thymeleaf-layouts","webflux","webflux-filter-interceptor","webflux-interceptor"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daggerok.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-29T01:31:51.000Z","updated_at":"2024-04-13T08:54:08.000Z","dependencies_parsed_at":"2022-09-18T05:36:15.674Z","dependency_job_id":null,"html_url":"https://github.com/daggerok/spring-boot-thymeleaf-layouts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fspring-boot-thymeleaf-layouts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fspring-boot-thymeleaf-layouts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fspring-boot-thymeleaf-layouts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Fspring-boot-thymeleaf-layouts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daggerok","download_url":"https://codeload.github.com/daggerok/spring-boot-thymeleaf-layouts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251366119,"owners_count":21578077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filter-interceptor","interceptor","layout","layouts","spring-boot","spring-boot-2","thymeleaf","thymeleaf-layout","thymeleaf-layouts","webflux","webflux-filter-interceptor","webflux-interceptor"],"created_at":"2024-11-11T15:27:18.571Z","updated_at":"2025-04-28T18:32:46.739Z","avatar_url":"https://github.com/daggerok.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"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\"]\n\n//tag::content[]\nThis repository contains example of using thymeleaf layouts (`nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect`)\nIn addition here also demonstrated webflux interceptor (WebFilter)\n\nHOW TO:\n\n* add dialect dependency\n\n* add java configuration\n\n[source,kotlin]\n----\n@Configuration\nclass ThymeleafLayoutConfig {\n  @Bean fun layoutDialect() = LayoutDialect()\n}\n----\n\n* add common layout `src/main/resources/templates/layouts/default.html`\n\n[source,xml]\n----\n\u003c!DOCTYPE html\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\n      xmlns:th=\"http://www.thymeleaf.org\"\n      xmlns:layout=\"http://www.ultraq.net.nz/thymeleaf/layout\"\u003e\n\u003chead\u003e\n  \u003ctitle\u003eCommon title\u003c/title\u003e\n  \u003c!-- common resources --\u003e\n  \u003clink rel=\"shortcut icon\" th:href=\"@{/favicon.ico}\" href=\"/favicon.ico\" type=\"image/x-icon\"\u003e\n  \u003clink rel=\"stylesheet\" th:href=\"@{/common/styles.css}\" href=\"/common/styles.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003c!-- common content --\u003e\n\u003cheader\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca th:href=\"@{/}\" href=\"/\"\u003eHome page\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca th:href=\"@{/info}\" href=\"/info\"\u003eInfo page\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/header\u003e\n\u003c!-- app-content / app-footer to be replaced in each view --\u003e\n\u003csection layout:fragment=\"app-content\"\u003e\n  \u003cp\u003eCommon layout fragment\u003c/p\u003e\n\u003c/section\u003e\n\u003cfooter\u003e\n  \u003ch5\u003eApp footer\u003c/h5\u003e\n  \u003cp layout:fragment=\"app-footer\"\u003eCommon app footer\u003c/p\u003e\n\u003c/footer\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n----\n\n* add views `src/main/resources/templates/index.html` or `src/main/resources/templates/info.html`\nwith proper declaration: `\u003chtml layout:decorate=\"~{layouts/default}\"\u003e`\n\n[source,html]\n----\n\u003c!DOCTYPE html\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\n      xmlns:th=\"http://www.thymeleaf.org\"\n      xmlns:layout=\"http://www.ultraq.net.nz/thymeleaf/layout\"\n      layout:decorate=\"~{layouts/default}\"\u003e\n\u003chead\u003e\n  \u003ctitle\u003e\n\n    title per view\n\n  \u003c/title\u003e\n  \u003clink rel=\"stylesheet\" th:href=\"@{/additional-styles.css}\" href=\"/additional-styles.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003csection layout:fragment=\"app-content\"\u003e\n  \u003ch3\u003eInfo header h3\u003c/h3\u003e\n  \u003cp\u003e\n\n    section content per view\n\n  \u003c/p\u003e\n\u003c/section\u003e\n\u003cfooter\u003e\n  \u003cp layout:fragment=\"app-footer\"\u003e\n\n    footer content per view\n\n  \u003c/p\u003e\n\u003c/footer\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n----\n\n== build / run\n\n.gradle\n[source,bash]\n----\n./gradlew\njava -jar build/libs/*.jar\nbash build/libs/*.jar\n\n./gradlew build composeUp\n./gradlew composeDown\n----\n\n.maven\n[source,bash]\n----\n./mvnw\njava -jar target/*.jar\nbash target/*.jar\n\n./mvnw; ./mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:up\n./mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:down\n----\n\nlinks:\n\n- link:https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#template-layout[Thymeleaf 3 is natively supports layouts]\n- link:https://ultraq.github.io/thymeleaf-layout-dialect/Examples.html#layouts[Thymeleaf layouts docs]\n- link:https://github.com/ultraq/thymeleaf-layout-dialect[Github: ultraq/thymeleaf-layout-dialect]\n\ngenerated by link:https://github.com/daggerok/generator-jvm/[jvm] yeoman generator\n//end::content[]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggerok%2Fspring-boot-thymeleaf-layouts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaggerok%2Fspring-boot-thymeleaf-layouts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggerok%2Fspring-boot-thymeleaf-layouts/lists"}