site.lyte.dev/themes/lyte/layouts/_default/baseof.html
2020-07-14 16:47:54 -05:00

39 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
{{ block "head-begin" . }}{{ end }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ block "title" . }}
{{ .Site.Title }}
{{ end }}</title>
<link rel="shortcut icon" href="/icon.png" />
<link rel="stylesheet" href="/styles.css" />
{{ block "head-end" . }}{{ end }}
</head>
<body>
<header>
<section>
<a href="/"><img src="/icon.png" /></a>
<a href="/"><h1>lyte.dev</h1></a>
</section>
<section>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ $active := or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
{{ $active = or $active (eq .Name $currentPage.Title) }}
{{ $active = or $active (and (eq .Name "Blog") (eq $currentPage.Section "post")) }}
{{ $active = or $active (and (eq .Name "Tags") (eq $currentPage.Section "tags")) }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</section>
</header>
{{ block "body-begin" . }}{{ end }}
<main>
{{ block "main" . }}
{{ .Content }}
{{ end }}
</main>
{{ block "body-end" . }}{{ end }}
</body>
</html>