-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.html
293 lines (278 loc) · 13 KB
/
page.html
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html>
<!--%
if page.get("lang", "en") == "de":
print('<html lang="de">')
else:
print('<html lang="en">')
%-->
<head>
<meta charset="{{ htmlspecialchars(__encoding__) }}" />
<title>{{ htmlspecialchars(page.get("post", "Blog")) if page.title == "Blog" else htmlspecialchars(page.title) }} - xythobuz.de</title>
<meta name="description" content="{{ htmlspecialchars(page.get("description", "Electronics & Software Projects")) }}" />
<meta name="keywords" content="{{ htmlspecialchars(page.get("keywords", "xythobuz")) }}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="img/favicon.ico" />
<link rel="alternate" type="application/rss+xml" title="xythobuz.de" href="rss.xml" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/print.css" media="print" />
<link type="text/css" rel="stylesheet" href="css/gh-fork-ribbon.css" />
<link type="text/css" rel="stylesheet" href="css/lightgallery.min.css" />
</head>
<body onload="loadPage()">
<!--%
link = ""
if page.get("github", "") != "":
link = page.github
if page.get("git", "") != "":
link = page.git
if link != "":
# GitHub Fork-Me Ribbon
print('<div class="github-fork-ribbon-wrapper right-bottom">')
print('<div class="github-fork-ribbon"><a href="')
print(link)
print('">Fork this with Git</a></div></div>')
%-->
<div id="wrap"><div id="nav">
<ul id="navbar">
<li id="home"><a href="index.html">xythobuz.de</a></li>
<!--%
mpages = [p for p in pages if p.get("parent", "") == "main" and p.lang == "en"]
mpages.sort(key=lambda p: int(p["position"]))
entry = ' <li><a href="%s">%s</a></li>'
for p in mpages[1:]:
print(entry % (htmlspecialchars(p["url"]), htmlspecialchars(p["title"])))
%-->
<li>-</li>
<li><a href="https://git.xythobuz.de/explore/repos">Gitea</a></li>
<li><a href="https://github.com/xythobuz">GitHub</a></li>
<li><a href="printer.html">🔨</a></li>
<div class="fonts">
<li><span class="font-big">Text:</span></li>
<li><a class="dec" href="#"><span class="font-big">A</span><span class="font-small">A</span></a></li>
<li><a class="reset" href="#"><span class="font-big">A</span><span class="font-big">A</span></a></li>
<li><a class="inc" href="#"><span class="font-small">A</span><span class="font-big">A</span></a></li>
</div>
<!--%
PY3 = sys.version_info[0] == 3
tmp = [p for p in ((iter(page["lang_links"].items())) if PY3 else (page["lang_links"].iteritems()))]
if len(tmp) > 1:
print(' <li>')
print(" ".join(["<li><a href='%s'>%s</a></li>" % (url, lang) for lang, url in ((iter(page["lang_links"].items())) if PY3 else (page["lang_links"].iteritems()))]).replace(">en<", '><img src="img/en.png" alt="English"><').replace(">de<", '><img src="img/de.png" alt="Deutsch"><'))
print("</li>")
%-->
</ul>
</div></div>
<div id="content">
<!--%
from datetime import datetime
if page.get("noheader", "false") == "false":
if page.get("title", "") == "Blog":
print("<h1>%s</h1>" % (page.get("post", "")))
else:
if page.get("lang", "en") == "de":
print("<h1>%s</h1>" % (page.get("title_de", "")))
else:
print("<h1>%s</h1>" % (page.get("title", "")))
if page.get("lang", "en") == "de":
if page.get("description_de", "") != "":
print("<h5>%s</h5>" % (page.get("description_de", "")))
elif page.get("description", "") != "":
print("<h5>%s</h5>" % (page.get("description", "")))
else:
if page.get("description", "") != "":
print("<h5>%s</h5>" % (page.get("description", "")))
if page.get("date", "") != "":
if page.get("title", "") == "Blog":
if page.get("lang", "en") == "de":
date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%d.%m.%Y")
print("<i>Veröffentlicht am %s.</i>" % date)
else:
date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
print("<i>Published on %s.</i>" % date)
else:
if page.get("lang", "en") == "de":
date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%d.%m.%Y")
print("<i>Projekt gestartet am %s.</i>" % date)
else:
date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
print("<i>Project started on %s.</i>" % date)
if page.get("date", "") != "" and page.get("update", "") != "":
print("<br>")
if page.get("update", "") != "":
if page.get("lang", "en") == "de":
date = datetime.strptime(page["update"], "%Y-%m-%d").strftime("%d.%m.%Y")
print("<i>Zuletzt aktualisiert am %s.</i>" % date)
else:
date = datetime.strptime(page["update"], "%Y-%m-%d").strftime("%B %d, %Y")
print("<i>Last updated on %s.</i>" % date)
link = githubCommitBadge(page, True)
if len(link) > 0:
print("<p>Recent activity on GitHub: " + link + "</p>")
%-->
{{ __content__ }}
<hr id="footbar">
<!--%
# Comments
if page.get("comments", "false") == "true":
print('<div id="commento"></div>')
print('<hr>')
elif page.get("comments", "false") != "false":
print('<div style="text-align: center;"><a href="%s">Head over here to discuss this article!</a></div>' % page.get("comments", "false"))
print('<hr>')
%-->
</div>
<div id="footer">
<a href="https://hg.sr.ht/~obensonne/poole">Poole</a>
·
<a href="http://shjs.sourceforge.net">SHJS</a>
·
<a href="https://github.com/sachinchoolur/lightGallery">lightGallery</a>
·
<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC-BY-NC-SA</a>
·
<a href="https://github.com/sponsors/xythobuz">GitHub Sponsors</a>
·
<a href="http://www.amazon.de/?_encoding=UTF8&camp=1638&creative=19454&linkCode=ur2&site-redirect=de&tag=xythobuzorg-21">Amazon.de Affiliate</a>
·
<a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_send-money&nav=1&[email protected]">PayPal</a>
</div>
<script type="text/javascript">
function loadPage() {
// adapted from https://sourceforge.net/p/shjs/feature-requests/5/#0940
$("pre[class^='sh_']").each(function() {
// wrap pre with div._sh
$('<div class="_sh"><div class="_sh_lines"></div></div>').insertBefore($(this));
$(this).appendTo($(this).prev('._sh'));
// split content of pre with linebreaks so we can get total line number
var content = $.trim($(this).html());
var lines = content.split('\n');
// append line number to span._sh_lines
for(var line = 1; line < lines.length + 1; line++) {
$(this).prev('._sh_lines').append('<span data-line="' + line + '">' + line + '</span>');
}
});
$("pre:not([class^='sh_']):not([class='ascii'])").each(function() {
// wrap pre with div._sh
$('<div class="_sh"></div>').insertBefore($(this));
$(this).appendTo($(this).prev('._sh'));
});
sh_highlightDocument('/js/sh/', '.min.js');
}
</script>
<script type="text/javascript" src="js/sh_main.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<!--%
if page.get("comments", "false") == "true":
print('<script defer src="https://comments.xythobuz.de/js/commento.js"></script>')
%-->
<script type="text/javascript">
$(document).ready(function() {
jQuery(window).resize(function() {
$('#wrap').css('height', $('#nav').css('height'));
});
var fontSize = parseInt($('body').css('font-size'), 10);
var initialFontSize = fontSize;
$('.inc').on('click', function() {
fontSize += 1;
$('#content').css('font-size', fontSize + 'px');
})
$('.dec').on('click', function() {
if (fontSize > 1) {
fontSize -= 1;
$('#content').css('font-size', fontSize + 'px');
}
})
$('.reset').on('click', function() {
if (fontSize != initialFontSize) {
fontSize = initialFontSize;
$('#content').css('font-size', initialFontSize + 'px');
}
})
$(document).keypress(function(event) {
if (event.charCode == '+'.charCodeAt(0)) {
fontSize += 1;
$('#content').css('font-size', fontSize + 'px');
}
if (event.charCode == '-'.charCodeAt(0)) {
if (fontSize > 1) {
fontSize -= 1;
$('#content').css('font-size', fontSize + 'px');
}
}
if (event.charCode == '0'.charCodeAt(0)) {
if (fontSize != initialFontSize) {
fontSize = initialFontSize;
$('#content').css('font-size', initialFontSize + 'px');
}
}
});
})
</script>
<script type="text/javascript" src="js/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="js/lightgallery-all.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var lg = document.getElementsByClassName("lightgallery");
for (var i = 0; i < lg.length; i++) {
var settings = {
loadYoutubeThumbnail: true,
youtubeThumbSize: 'mqdefault',
loadVimeoThumbnail: true,
vimeoThumbSize: 'thumbnail_medium',
youtubePlayerParams: {
modestbranding: 1,
showinfo: 0,
rel: 0
},
vimeoPlayerParams: {
byline: 0,
portrait: 0
},
thumbnail:true,
animateThumb: true,
showThumbByDefault: false,
galleryId: i,
hideBarsDelay: 2500
};
var d = lg.item(i);
if ($(d).find(".border").length > 0) {
settings.selector = '.border';
}
$(d).lightGallery(settings);
}
});
</script>
<script>
var coll = document.getElementsByClassName("collapse");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("collapseactive");
var content = this.nextElementSibling;
if (content.style.maxHeight) {
content.style.maxHeight = null;
setTimeout(function() {
content.style.borderWidth = null;
}, 800);
} else {
content.style.maxHeight = content.scrollHeight + "px";
content.style.borderWidth = "2px";
}
});
}
</script>
<script>
(function(f, a, t, h, o, m){
a[h]=a[h]||function(){
(a[h].q=a[h].q||[]).push(arguments)
};
o=f.createElement('script'),
m=f.getElementsByTagName('script')[0];
o.async=1; o.src=t; o.id='fathom-script';
m.parentNode.insertBefore(o,m)
})(document, window, '//stats.xythobuz.de/tracker.js', 'fathom');
fathom('set', 'siteId', 'APYRK');
fathom('trackPageview');
</script>
</body>
</html>