aboutsummaryrefslogtreecommitdiff
path: root/templates/base.html
blob: d449492274a77ef6dcd1fe0072552de458ef8b08 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!doctype html>
<html lang="{{ .Config.Language }}">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1" />

		<title>{{ block "title" . }}{{ .Config.Title }}{{ end }}</title>
		<meta name="description" content="{{ block "description" . }}{{ .Config.Description }}{{ end }}"/>
		
		<link rel="alternate" type="application/rss+xml" href="{{ .Config.BaseURL }}/index.xml" />
		<link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL69vf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv76+/8LBwQkAAAAAAAAAAAAAAAC+vb3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+9vf/Bv78JAAAAAAAAAAAAAAAAu7q6/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC7ubr/vr29CAAAAAAAAAAAy8nJAZ6foP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnqGj/6GipAoAAAAAHLjU/xcXHf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AAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel="icon" type="image/x-icon" />

		<style>
			:root {
				--base-background: white;
				--base-color: black;
				--link-color: blue;
				--first-child-width: 150px;
				--primary-color: gainsboro;
				--secondary-color: black;
				--tertiary-color: #eee;
				--code-color: #f9f9f9;
				--border-width: 1px;
				--header-color: black;
				--header-border-width: 2px;
				--content-width: 840px;
			}

			* { box-sizing: border-box; }

			html { scroll-padding-top: 1.5em; }
			body { font-family: sans-serif; padding: 0 1em; line-height: 160%; display: flex; flex-direction: column; gap: 4em; background: var(--base-background); color: var(--base-color); }
			table { width: 100%; border: var(--border-width) solid var(--primary-color); border-collapse: collapse; }
			table thead { background: var(--primary-color); border: var(--border-width) solid var(--secondary-color); color: var(--header-color); }
			table td, table th { text-align: left; padding: 0.3em 0.5em; }
			table tbody tr { border-bottom: var(--border-width) solid var(--primary-color); vertical-align: middle; }
			table tr td:first-child { width: var(--first-child-width); }
			table.normal tr td:first-child { width: auto; }
			table td.tags { display: flex; gap: 0.5em; justify-content: flex-end; align-items: center; }
			table td.tags mark { padding: 0 0.4em; background: var(--primary-color); font-size: small; }

			a { color: var(--link-color); text-decoration: none; }
			a:hover { text-decoration: underline; }

			header { border-bottom: var(--header-border-width) solid var(--secondary-color); padding: 0.5em 0; }
			header div { min-width: var(--content-width); max-width: var(--content-width); display: flex; }
			header div nav:first-child { display: flex; width: var(--first-child-width); }
			header div nav:nth-child(2) { display: flex; gap: 1.5em; }
			header div nav:nth-child(2) a { color: var(--base-color); }
			header div nav:last-child { text-align: right; margin-left: auto; display: flex; }

			footer { color: gray; }
			footer div { min-width: var(--content-width); max-width: var(--content-width); }
			footer a { color: gray; text-decoration: underline; }

			main {  min-width: var(--content-width); max-width: var(--content-width); display: flex; gap: 2em; flex-direction: column; }
			h1, h2, h3, h4 { font-size: initial; }
			article h2, article h3, article h4 { margin-block-start: 2.5em; }
			article h1 { font-size: 130%; line-height: 110%; }

			img, video, audio { max-width: 100%; }
			figure { display: flex; justify-content: center; margin: 2.5em 0; }
			img, video { border: var(--border-width) solid var(--primary-color); padding: 0.5em; }
			img.no-border, video.no-border, img[src$="?no-border"] { border: 0; padding: 0; }

			pre { background: var(--code-color)!important; border: var(--border-width) solid var(--primary-color); text-wrap: wrap; padding: 1.0em; line-height: 170%; text-wrap: nowrap; overflow-x: auto; }
			code { background: var(--code-color); padding: 0 0.2em; }
			pre code { padding: 0; }

			.capitalize { text-transform: capitalize; }
			
			.text-left { text-align: left; }
			.text-center { text-align: center; }
			.text-right { text-align: right; }

			.content-center { margin: 0 auto; }

			#content_align_button { display: none; }

			/* Hotfixes for strange behaviour. */
			article iframe { margin: 0!important; }
			pre code span { display: initial !important; }

			@media print {
				header, footer { display: none; }
			}
		</style>
		<script defer src="https://app.tinyanalytics.io/pixel/isfRNEahfHiS2Ttp"></script>
	</head>

	<body>
		<header>
			<div class="content">
				<nav>
					<span><strong>Navigation</strong></span>
				</nav>
				<nav>
					<span><a href="/">Home</a></span>
					<span><a href="/projects.html">Projects</a></span>
					<span><a href="https://github.com/mitjafelicijan/probe" target="_blank">Probe</a></span>
					<span><a href="https://github.com/mitjafelicijan" target="_blank">Code</a></span>
					<span><a href="https://github.com/mitjafelicijan/dotfiles" target="_blank">Dotfiles</a></span>
					<span><a href="/curriculum-vitae.html">CV</a></span>
					<span><a href="/feed.xml">RSS</a></span>
				</nav>
				<nav>
					<button id="content_align_button">center</button>
					<script>content_align_button.style.display = "block";</script>
				</nav>
			</div>
		</header>

		<main class="content">
			{{ block "content" . }}{{ end }}
		</main>

		<footer>
			<div class="content">
				<p>You can write me an email at <a href="mailto:mitja.felicijan@gmail.com">mitja.felicijan@gmail.com</a> or catch up with me <a href="https://telegram.me/mitjafelicijan" target="_blank">on Telegram</a>.</p>
				<p>This page's is also available as <a href="/feed.xml" target="_blank">RSS feed</a>. Page was built with <a href="https://github.com/mitjafelicijan/jbmafp" target="_blank">jbmafp</a>.</p>
			</div>
		</footer>

		<script>
			function align_content_left() {
				document.querySelectorAll(".content").forEach(el => {
					el.classList.remove("content-center");
				});
				content_align_button.innerText = "center";
				localStorage.setItem("content-align", "left");
			}

			function align_content_center() {
				document.querySelectorAll(".content").forEach(el => {
					el.classList.add("content-center");
				});
				content_align_button.innerText = "left";
				localStorage.setItem("content-align", "center");
			}

			{
				let initial_align = localStorage.getItem("content-align");
				if (!initial_align) {
					localStorage.setItem("content-align", "left");
					initial_align = localStorage.getItem("content-align");
				}

				if (initial_align == "center") {
					align_content_center();
				}
			}

			content_align_button.onclick = function(e) {
				const align = localStorage.getItem("content-align");
				if (align == "center") { align_content_left(); }
				if (align == "left") { align_content_center(); }
			}
		</script>
	</body>
</html>