Multiple pages
This commit is contained in:
@ -1,16 +1,34 @@
|
||||
package templates
|
||||
|
||||
templ baseLayout() {
|
||||
templ baseLayout(pc PageContext) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"/>
|
||||
<link rel="stylesheet" href="/static/styles.css"/>
|
||||
<title>Document</title>
|
||||
<title>{ pc.Title }</title>
|
||||
</head>
|
||||
<body>
|
||||
{ children... }
|
||||
<div class="container">
|
||||
<h1 class="mb-3">
|
||||
Go + templ demo
|
||||
</h1>
|
||||
<ul class="nav nav-pills mb-5">
|
||||
<li class="nav-item">
|
||||
<a class={ "nav-link", templ.KV("active", pc.ActivePage == "home") } aria-current="page" href="/">
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class={ "nav-link", templ.KV("active", pc.ActivePage == "about") } aria-current="page" href="/about">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{ children... }
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user