My static website generator using poole https://www.xythobuz.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

page.html 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <!DOCTYPE html>
  2. <!--%
  3. if page.get("lang", "en") == "de":
  4. print('<html lang="de">')
  5. else:
  6. print('<html lang="en">')
  7. %-->
  8. <head>
  9. <meta charset="{{ htmlspecialchars(__encoding__) }}" />
  10. <title>{{ htmlspecialchars(page.get("post", "Blog")) if page.title == "Blog" else htmlspecialchars(page.title) }} - xythobuz.de</title>
  11. <meta name="description" content="{{ htmlspecialchars(page.get("description", "Electronics & Software Projects")) }}" />
  12. <meta name="keywords" content="{{ htmlspecialchars(page.get("keywords", "xythobuz")) }}" />
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  14. <link rel="shortcut icon" href="{{ page.get("favicon", "img/favicon.ico") }}" />
  15. <link rel="alternate" type="application/rss+xml" title="xythobuz.de" href="rss.xml" />
  16. <link type="text/css" rel="stylesheet" href="css/style.css" />
  17. <link type="text/css" rel="stylesheet" href="css/print.css" media="print" />
  18. <link type="text/css" rel="stylesheet" href="css/gh-fork-ribbon.css" />
  19. <link type="text/css" rel="stylesheet" href="css/lightgallery.min.css" />
  20. <!--%
  21. if page.get("auto_toc", "false") == "true":
  22. print('<link type="text/css" rel="stylesheet" href="css/auto_toc.css" />')
  23. %-->
  24. </head>
  25. <body onload="loadPage()">
  26. <!--%
  27. link = ""
  28. if page.get("github", "") != "":
  29. link = page.github
  30. if page.get("git", "") != "":
  31. link = page.git
  32. if link != "":
  33. # GitHub Fork-Me Ribbon
  34. print('<div class="github-fork-ribbon-wrapper right-bottom">')
  35. print('<div class="github-fork-ribbon"><a href="')
  36. print(link)
  37. print('">Fork this with Git</a></div></div>')
  38. %-->
  39. <div id="wrap"><div id="nav">
  40. <ul id="navbar">
  41. <li id="home"><a href="index.html">xythobuz.de</a></li>
  42. <!--%
  43. mpages = [p for p in pages if p.get("parent", "") == "main" and p.lang == "en"]
  44. mpages.sort(key=lambda p: int(p["position"]))
  45. entry = ' <li><a href="%s">%s</a></li>'
  46. for p in mpages[1:]:
  47. print(entry % (htmlspecialchars(p["url"]), htmlspecialchars(p["title"])))
  48. %-->
  49. <li>-</li>
  50. <li><a href="https://codeberg.org/xythobuz">Codeberg</a></li>
  51. <li><a href="https://git.xythobuz.de/explore/repos">Gitea</a></li>
  52. <li><a href="https://github.com/xythobuz">GitHub</a></li>
  53. <!-- <li><a href="printer.html">🔨</a></li> -->
  54. <div class="fonts">
  55. <li><span class="font-big">Text:</span></li>
  56. <li><a class="dec" href="#"><span class="font-big">A</span><span class="font-small">A</span></a></li>
  57. <li><a class="reset" href="#"><span class="font-big">A</span><span class="font-big">A</span></a></li>
  58. <li><a class="inc" href="#"><span class="font-small">A</span><span class="font-big">A</span></a></li>
  59. </div>
  60. <!--%
  61. PY3 = sys.version_info[0] == 3
  62. tmp = [p for p in ((iter(page["lang_links"].items())) if PY3 else (page["lang_links"].iteritems()))]
  63. if len(tmp) > 1:
  64. print(' <li>')
  65. 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"><'))
  66. print("</li>")
  67. %-->
  68. </ul>
  69. </div></div>
  70. <!--%
  71. if page.get("auto_toc", "false") == "true":
  72. print('<div id="toc_wrap"></div>')
  73. %-->
  74. <div id="content">
  75. <!--%
  76. from datetime import datetime
  77. if page.get("noheader", "false") == "false":
  78. if page.get("title", "") == "Blog":
  79. print("<h1>%s</h1>" % (page.get("post", "")))
  80. else:
  81. if page.get("lang", "en") == "de":
  82. print("<h1>%s</h1>" % (page.get("title_de", "")))
  83. else:
  84. print("<h1>%s</h1>" % (page.get("title", "")))
  85. if page.get("lang", "en") == "de":
  86. if page.get("description_de", "") != "":
  87. print("<h5>%s</h5>" % (page.get("description_de", "")))
  88. elif page.get("description", "") != "":
  89. print("<h5>%s</h5>" % (page.get("description", "")))
  90. else:
  91. if page.get("description", "") != "":
  92. print("<h5>%s</h5>" % (page.get("description", "")))
  93. if page.get("date", "") != "":
  94. if page.get("title", "") == "Blog":
  95. if page.get("lang", "en") == "de":
  96. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%d.%m.%Y")
  97. print("<i>Ver&ouml;ffentlicht am %s.</i>" % date)
  98. else:
  99. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
  100. print("<i>Published on %s.</i>" % date)
  101. else:
  102. if page.get("lang", "en") == "de":
  103. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%d.%m.%Y")
  104. print("<i>Projekt gestartet am %s.</i>" % date)
  105. else:
  106. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
  107. print("<i>Project started on %s.</i>" % date)
  108. if page.get("date", "") != "" and page.get("update", "") != "":
  109. print("<br>")
  110. if page.get("update", "") != "":
  111. if page.get("lang", "en") == "de":
  112. date = datetime.strptime(page["update"], "%Y-%m-%d").strftime("%d.%m.%Y")
  113. print("<i>Zuletzt aktualisiert am %s.</i>" % date)
  114. else:
  115. date = datetime.strptime(page["update"], "%Y-%m-%d").strftime("%B %d, %Y")
  116. print("<i>Last updated on %s.</i>" % date)
  117. link = githubCommitBadge(page, True)
  118. if len(link) > 0:
  119. print("<p>Recent activity on GitHub: " + link + "</p>")
  120. if page.get("auto_toc", "false") == "true":
  121. print('<p class="access_link" id="toc_toggle_wrap"></p>')
  122. %-->
  123. {{ __content__ }}
  124. <hr id="footbar">
  125. <!--%
  126. # Comments
  127. if page.get("comments", "false") == "true":
  128. print('<div id="commento"></div>')
  129. print('<hr>')
  130. elif page.get("comments", "false") != "false":
  131. print('<div style="text-align: center;"><a href="%s">Head over here to discuss this article!</a></div>' % page.get("comments", "false"))
  132. print('<hr>')
  133. %-->
  134. </div>
  135. <div id="scroll_up"></div>
  136. <div id="footer">
  137. <a href="https://hg.sr.ht/~obensonne/poole">Poole</a>
  138. &middot;
  139. <a href="http://shjs.sourceforge.net">SHJS</a>
  140. &middot;
  141. <a href="https://github.com/sachinchoolur/lightGallery">lightGallery</a>
  142. &middot;
  143. <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC-BY-NC-SA</a>
  144. &middot;
  145. <a href="https://github.com/sponsors/xythobuz">GitHub Sponsors</a>
  146. &middot;
  147. <a href="http://www.amazon.de/?_encoding=UTF8&amp;camp=1638&amp;creative=19454&amp;linkCode=ur2&amp;site-redirect=de&amp;tag=xythobuzorg-21">Amazon.de Affiliate</a>
  148. &middot;
  149. <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_send-money&nav=1&email=xythobuz@me.com">PayPal</a>
  150. <br><span style="font-size: xx-small">
  151. Static HTML generated at <!--% print(datetime.now().strftime("%Y-%m-%d %H:%M:%S %z")) %-->
  152. </span>
  153. <br><span style="font-size: xx-small">
  154. <a href="<!--% print(page.get('fname').replace('./input/', '').replace('.de.md', '.md')) %-->">View Source '<!--% print(page.get("fname").replace('./input/', '').replace('.de.md', '.md')) %-->'</a>
  155. </span>
  156. </div>
  157. <script type="text/javascript">
  158. // helper to show or hide scroll-up-button depending on scroll position
  159. function scroll_visibility() {
  160. if ($(document).scrollTop() > 0) {
  161. $("#scroll_up").show("fast");
  162. } else {
  163. $("#scroll_up").hide("fast");
  164. }
  165. }
  166. function add_scroll_up() {
  167. // don't show on short pages
  168. if ($("html").outerHeight() <= $(window).height()) {
  169. return;
  170. }
  171. // add button, initially hidden
  172. $("<a>", {
  173. text: "⇑",
  174. id: "scroll_up_btn",
  175. click: function() {
  176. var hash = location.hash.replace("#","");
  177. if (hash != "") {
  178. const location = window.location.href.split('#')[0];
  179. window.history.pushState({}, "", location);
  180. }
  181. window.scrollTo({ top: 0, behavior: "auto" });
  182. return true;
  183. },
  184. }).appendTo('#scroll_up');
  185. $("#scroll_up").hide();
  186. // register handler and set initial state
  187. scroll_visibility();
  188. $(window).scroll(scroll_visibility);
  189. }
  190. function prepare_syntax_highlighting() {
  191. // adapted from https://sourceforge.net/p/shjs/feature-requests/5/#0940
  192. $("pre[class^='sh_']").each(function() {
  193. // wrap pre with div._sh
  194. $('<div class="_sh"><div class="_sh_lines"></div></div>').insertBefore($(this));
  195. $(this).appendTo($(this).prev('._sh'));
  196. // allow skipping line numbers
  197. if ($(this).attr("skip_line_no") != undefined) {
  198. return;
  199. }
  200. // split content of pre with linebreaks so we can get total line number
  201. var content = $.trim($(this).html());
  202. var lines = content.split('\n');
  203. // configurable line number offset
  204. var line_cnt_off = "1";
  205. if ($(this).attr("offset") != undefined) {
  206. line_cnt_off = $(this).attr("offset");
  207. }
  208. var max = lines.length + parseInt(line_cnt_off);
  209. // append line number to span._sh_lines
  210. for (var line = line_cnt_off; line < max; line++) {
  211. $(this).prev('._sh_lines').append('<span data-line="' + line + '">' + line + '</span>');
  212. }
  213. });
  214. $("pre:not([class^='sh_']):not([class='ascii'])").each(function() {
  215. // wrap pre with div._sh
  216. $('<div class="_sh"></div>').insertBefore($(this));
  217. $(this).appendTo($(this).prev('._sh'));
  218. });
  219. sh_highlightDocument('/js/sh/', '.min.js');
  220. }
  221. function loadPage() {
  222. prepare_syntax_highlighting();
  223. add_scroll_up();
  224. }
  225. </script>
  226. <script type="text/javascript" src="js/sh_main.js"></script>
  227. <script type="text/javascript" src="js/jquery.min.js"></script>
  228. <!--%
  229. if page.get("comments", "false") == "true":
  230. print('<script defer src="https://comments.xythobuz.de/js/commento.js"></script>')
  231. if page.get("auto_toc", "false") == "true":
  232. print('<script defer src="js/auto_toc.js"></script>')
  233. %-->
  234. <script type="text/javascript">
  235. $(document).ready(function() {
  236. jQuery(window).resize(function() {
  237. $('#wrap').css('height', $('#nav').css('height'));
  238. });
  239. var fontSize = parseInt($('body').css('font-size'), 10);
  240. var initialFontSize = fontSize;
  241. $('.inc').on('click', function() {
  242. fontSize += 1;
  243. $('#content').css('font-size', fontSize + 'px');
  244. })
  245. $('.dec').on('click', function() {
  246. if (fontSize > 1) {
  247. fontSize -= 1;
  248. $('#content').css('font-size', fontSize + 'px');
  249. }
  250. })
  251. $('.reset').on('click', function() {
  252. if (fontSize != initialFontSize) {
  253. fontSize = initialFontSize;
  254. $('#content').css('font-size', initialFontSize + 'px');
  255. }
  256. })
  257. $(document).keypress(function(event) {
  258. if (event.charCode == '+'.charCodeAt(0)) {
  259. fontSize += 1;
  260. $('#content').css('font-size', fontSize + 'px');
  261. }
  262. if (event.charCode == '-'.charCodeAt(0)) {
  263. if (fontSize > 1) {
  264. fontSize -= 1;
  265. $('#content').css('font-size', fontSize + 'px');
  266. }
  267. }
  268. if (event.charCode == '0'.charCodeAt(0)) {
  269. if (fontSize != initialFontSize) {
  270. fontSize = initialFontSize;
  271. $('#content').css('font-size', initialFontSize + 'px');
  272. }
  273. }
  274. });
  275. })
  276. </script>
  277. <script type="text/javascript" src="js/jquery.mousewheel.min.js"></script>
  278. <script type="text/javascript" src="js/lightgallery-all.min.js"></script>
  279. <script type="text/javascript">
  280. $(document).ready(function() {
  281. var lg = document.getElementsByClassName("lightgallery");
  282. for (var i = 0; i < lg.length; i++) {
  283. var settings = {
  284. loadYoutubeThumbnail: true,
  285. youtubeThumbSize: 'mqdefault',
  286. loadVimeoThumbnail: true,
  287. vimeoThumbSize: 'thumbnail_medium',
  288. youtubePlayerParams: {
  289. modestbranding: 1,
  290. showinfo: 0,
  291. rel: 0
  292. },
  293. vimeoPlayerParams: {
  294. byline: 0,
  295. portrait: 0
  296. },
  297. thumbnail:true,
  298. animateThumb: true,
  299. showThumbByDefault: false,
  300. galleryId: i,
  301. hideBarsDelay: 2500
  302. };
  303. var d = lg.item(i);
  304. if ($(d).find(".border").length > 0) {
  305. settings.selector = '.border';
  306. }
  307. $(d).lightGallery(settings);
  308. }
  309. });
  310. </script>
  311. <script>
  312. var coll = document.getElementsByClassName("collapse");
  313. var i;
  314. for (i = 0; i < coll.length; i++) {
  315. coll[i].addEventListener("click", function() {
  316. this.classList.toggle("collapseactive");
  317. var content = this.nextElementSibling;
  318. if (content.style.maxHeight) {
  319. content.style.maxHeight = null;
  320. setTimeout(function() {
  321. content.style.borderWidth = null;
  322. }, 800);
  323. } else {
  324. content.style.maxHeight = content.scrollHeight + "px";
  325. content.style.borderWidth = "2px";
  326. }
  327. });
  328. }
  329. </script>
  330. <script>
  331. (function(f, a, t, h, o, m){
  332. a[h]=a[h]||function(){
  333. (a[h].q=a[h].q||[]).push(arguments)
  334. };
  335. o=f.createElement('script'),
  336. m=f.getElementsByTagName('script')[0];
  337. o.async=1; o.src=t; o.id='fathom-script';
  338. m.parentNode.insertBefore(o,m)
  339. })(document, window, '//stats.xythobuz.de/tracker.js', 'fathom');
  340. fathom('set', 'siteId', 'APYRK');
  341. fathom('trackPageview');
  342. </script>
  343. </body>
  344. </html>