ch2.7
This commit is contained in:
19
ui/html/base.tmpl
Normal file
19
ui/html/base.tmpl
Normal file
@@ -0,0 +1,19 @@
|
||||
{{define "base"}}
|
||||
<!doctype html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>{{template "title" .}} - Snippetbox</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1><a href='/'>Snippetbox</a></h1>
|
||||
</header>
|
||||
{{template "nav" .}}
|
||||
<main>
|
||||
{{template "main" .}}
|
||||
</main>
|
||||
<footer>Powered by <a href='https://golang.org/'>Go</a></footer>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
6
ui/html/pages/home.tmpl
Normal file
6
ui/html/pages/home.tmpl
Normal file
@@ -0,0 +1,6 @@
|
||||
{{define "title"}}Home{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
<h2>Latest Snippets</h2>
|
||||
<p>There's nothing to see here yet!</p>
|
||||
{{end}}
|
||||
5
ui/html/partials/nav.tmpl
Normal file
5
ui/html/partials/nav.tmpl
Normal file
@@ -0,0 +1,5 @@
|
||||
{{define "nav"}}
|
||||
<nav>
|
||||
<a href='/'>Home</a>
|
||||
</nav>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user