1. header.mustache
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>blog</title>
</head>
<body>
<nav>
<ul>
<li>
<a href="/">홈</a>
</li>
<li>
<a href="/save-form">글쓰기</a>
</li>
</ul>
</nav>
<hr>
- 모든 페이지의 상단에 들어갈
header.mustache
파일을layout
폴더에 생성한다.
2. 적용할 템플릿
{{> layout/header}}
<section>
<div>
번호: {{model.id}}<br>
제목: {{model.title}}<br>
내용: {{model.content}}<br>
작성일: {{model.createdAt}}<br>
</div>
</section>
</body>
</html>
- 중괄호 두 개 사이에
>
를 붙이고 그 뒤에 경로와 Mustache 파일명을 작성하여 부분 템플릿을 삽입한다.
Share article