<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>노마드 코인</title>
</head>
<body>
<h1>{{.PageTitle}}</h1>
{{range .Blocks}} {{.Data}} {{end}}
</body>
</html>
func home(rw http.ResponseWriter, r *http.Request) {
tmpl := template.Must(template.ParseFiles("templates/home.gohtml"))
data := homeData{"Home", blockchain.GetBlockchain().AllBlocks()}
tmpl.Execute(rw, data)
}
<body>
<h1>{{.PageTitle}}</h1>
{{range .Blocks}}
<div>
<ul>
<li>{{.Data}}</li>
<li>{{.Hash}}</li>
<li>{{.PrevHash}}</li>
</ul>
</div>
{{end}}
</body>
</html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/mvp.css">
<title>노마드 코인</title>
</head>
<header>
<h1>{{.PageTitle}}</h1>
</header>
<body>
<header>
<h1>{{.PageTitle}}</h1>
</header>
<main>
{{range .Blocks}}
<div>
<ul>
<li>{{.Data}}</li>
<li>{{.Hash}}</li>
<li>{{.PrevHash}}</li>
</ul>
</div>
{{end}}
</main>
</body>
<body>
<header>
<h1>{{.PageTitle}}</h1>
</header>
<main>
{{range .Blocks}}
<section>
<ul>
<li>{{.Data}}</li>
<li>{{.Hash}}</li>
<li>{{.PrevHash}}</li>
</ul>
</section>
{{end}}
</main>
</body>
강의 : 노마드코더 노마드코인
[Nomad Coin] Explorer - #5.4 Adding A Block (0) | 2022.07.18 |
---|---|
[Nomad Coin] Explorer - #5.3 Using Partials (0) | 2022.07.18 |
[Nomad Coin] Explorer - #5.1 Rendering Templates (0) | 2022.07.17 |
[Nomad Coin] Explorer - #5.0 Setup (0) | 2022.07.16 |
[Nomad Coin] Blockchain - #4.5 Refactoring part Two (0) | 2022.07.16 |
댓글 영역