Skip to content

Commit

Permalink
템플릿 레이아웃 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kiteB committed Sep 21, 2021
1 parent a56e7db commit 430d2e0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ public class TemplateController {
public String template() {
return "template/fragment/fragmentMain";
}

@GetMapping("/layout")
public String layout() {
return "template/layout/layoutMain";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="common_header(title,links)">

<title th:replace="${title}">레이아웃 타이틀</title>

<!-- 공통 -->
<link rel="stylesheet" type="text/css" media="all" th:href="@{/css/awesomeapp.css}">
<link rel="shortcut icon" th:href="@{/images/favicon.ico}">
<script type="text/javascript" th:src="@{/sh/scripts/codebase.js}"></script>

<!-- 추가 -->
<th:block th:replace="${links}" />
</head>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="template/layout/base :: common_header(~{::title},~{::link})">
<title>메인 타이틀</title>
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
<link rel="stylesheet" th:href="@{/themes/smoothness/jquery-ui.css}">
</head>
<body>
메인 컨텐츠
</body>
</html>

0 comments on commit 430d2e0

Please sign in to comment.