summaryrefslogtreecommitdiff
path: root/layouts/baseof.html
blob: fb923a51848040605b89ea1c0862719bad7502ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>{{ .Page.Title }}</title>
	<link rel="stylesheet" href="/css/main.css"/>
	<link rel="stylesheet" href="/css/chroma.css"/>
	{{ if isset .Site.Params "favicons" }}
		{{ $fileDict := dict
			".svg" "svg+xml"
			".png" "png"
			".ico" "x-icon"
		}}
		{{ range .Site.Params.favicons }}
			<link rel="icon" 
				type="image/{{ index $fileDict ( path.Ext . ) }}" 
				href="{{ . }}">
		{{ end }}
	{{ end }}	
	{{ if isset .Params "tags" }}
		<meta name="keywords" content="{{ delimit .Params.tags ", " }}">
	{{ end }}
	{{ if isset .Params "htmlhead" }}
		{{ range .Params.htmlHead }}
			{{ . | safeHTML }}
		{{ end }}
	{{ end }}	
	<style>
		:root {
			{{ with merge .Site.Params .Params }}
				--theme-color-check: {{ int .themeColorCheck }};
				--accent-color-check: {{ int .accentColorCheck }};
				--theme-hue: {{ .themeHue }};
				--accent-hue: {{ .accentHue }};
			{{ end }}
		}
	</style>
</head>
<body>
	<div class="dark-mode-container">
		<input type="checkbox" id="--dark-theme-check">Dark Mode</input>
	</div>
	{{ block "main" . }}
	{{ end }}
	{{ if isset .Params "tags" }}
		<nav class="nav-footer">
			<hr>
			Related: 
			{{ range .Params.tags }}
				<a href="/tags/{{ . }}">{{ . }}</a>
				{{ if not (eq . (index (last 1 $.Params.tags) 0)) }} | {{ end }}
			{{ end }}
		</nav>
	{{ end }}
	<nav class="nav-footer">
		<hr>
		<a href="/">Home Page</a>
		{{ range where .Site.Sections "Section" "about" }}
			| <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
		{{ end }}
		| <a href="#">Top of Page</a>
		<hr>
	</nav>
	<script src="/css/dark-mode.js"></script>
	{{ if isset .Params "htmlfoot" }}
		{{ range .Params.htmlFoot }}
			{{ . | safeHTML }}
		{{ end }}
	{{ end }}	
</body>
</html>