▌建立一個layout.ejs
在裡面放 <%-body%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>訂閱尼桑</title>
<link rel="stylesheet" href="/css/reset.css">
<script src="/build/jquery.min.js"></script>
<script src="/build/toastr.min.js"></script>
<link rel="stylesheet" href="/css/toastr.min.css">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<%-body%>
</body>
<script src="https://www.gstatic.com/firebasejs/5.7.1/firebase.js"></script>
<script src="/build/script.js"></script>
</html>
▌引入layout.ejs
<% layout('layout') %>
<div>我要的html內容</div>
沒有留言:
張貼留言