Broke out main layout in header/footer

This commit is contained in:
Gregory Ballantine 2023-10-06 10:43:45 -06:00
parent b80b4150d5
commit b450ed7d2b
3 changed files with 20 additions and 11 deletions

View File

@ -1,11 +1,5 @@
<!DOCTYPE html> {{ template "header" . }}
<html lang="en">
<head> <p>This is a test!</p>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> {{ template "footer" . }}
<title>{{ .title }}</title>
</head>
<body>
<p>This is a test!</p>
</body>
</html>

4
views/layout/footer.html Normal file
View File

@ -0,0 +1,4 @@
{{ define "footer" }}
</body>
</html>
{{ end }}

11
views/layout/header.html Normal file
View File

@ -0,0 +1,11 @@
{{ define "header" }}
<!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 }} | BLT</title>
</head>
<body>
{{ end }}