My static website generator using poole https://www.xythobuz.de
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

page.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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.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="author" href="xythobuz@xythobuz.de" />
  15. <link rel="shortcut icon" href="img/favicon.ico" />
  16. <link rel="alternate" type="application/rss+xml" title="xythobuz.de" href="rss.xml" />
  17. <link type="text/css" rel="stylesheet" href="css/style.css" />
  18. <link type="text/css" rel="stylesheet" href="css/print.css" media="print" />
  19. <link type="text/css" rel="stylesheet" href="css/gh-fork-ribbon.css" />
  20. <link type="text/css" rel="stylesheet" href="css/lightgallery.min.css" />
  21. </head>
  22. <body onload="loadPage()">
  23. <!--%
  24. link = ""
  25. if page.get("github", "") != "":
  26. link = page.github
  27. if page.get("git", "") != "":
  28. link = page.git
  29. if link != "":
  30. # GitHub Fork-Me Ribbon
  31. print '<div class="github-fork-ribbon-wrapper right-bottom">'
  32. print '<div class="github-fork-ribbon"><a href="'
  33. print link
  34. print '">Fork this with Git</a></div></div>'
  35. %-->
  36. <div id="wrap"><div id="nav">
  37. <ul id="navbar">
  38. <li id="home"><a href="index.html">xythobuz.de</a></li>
  39. <!--%
  40. mpages = [p for p in pages if p.get("parent", "") == "main" and p.lang == "en"]
  41. mpages.sort(key=lambda p: int(p["position"]))
  42. entry = ' <li><a href="%s">%s</a></li>'
  43. for p in mpages[1:]:
  44. print(entry % (htmlspecialchars(p["url"]), htmlspecialchars(p["title"])))
  45. %-->
  46. <li>-</li>
  47. <li><a href="https://git.xythobuz.de/explore/repos">Gitea</a></li>
  48. <li><a href="https://github.com/xythobuz">GitHub</a></li>
  49. <li><a href="printer.html">🔨</a></li>
  50. <div class="fonts">
  51. <li><span class="font-big">Text:</span></li>
  52. <li><a class="dec" href="#"><span class="font-big">A</span><span class="font-small">A</span></a></li>
  53. <li><a class="reset" href="#"><span class="font-big">A</span><span class="font-big">A</span></a></li>
  54. <li><a class="inc" href="#"><span class="font-small">A</span><span class="font-big">A</span></a></li>
  55. </div>
  56. <!--%
  57. tmp = [p for p in page["lang_links"].iteritems()]
  58. if len(tmp) > 1:
  59. print ' <li>'
  60. print " ".join(["<li><a href='%s'>%s</a></li>" % (url, lang) for lang, url in page["lang_links"].iteritems()]).replace(">en<", '><img src="img/en.png" alt="English"><').replace(">de<", '><img src="img/de.png" alt="Deutsch"><')
  61. print "</li>"
  62. %-->
  63. </ul>
  64. </div></div>
  65. <div id="content">
  66. <!--%
  67. from datetime import datetime
  68. if page.get("noheader", "false") == "false":
  69. if page.get("title", "") == "Blog":
  70. print "<h1>%s</h1>" % (page.get("post", ""))
  71. else:
  72. if page.get("lang", "en") == "de":
  73. print "<h1>%s</h1>" % (page.get("title_de", ""))
  74. else:
  75. print "<h1>%s</h1>" % (page.get("title", ""))
  76. if page.get("lang", "en") == "de":
  77. if page.get("description_de", "") != "":
  78. print "<h5>%s</h5>" % (page.get("description_de", ""))
  79. elif page.get("description", "") != "":
  80. print "<h5>%s</h5>" % (page.get("description", ""))
  81. else:
  82. if page.get("description", "") != "":
  83. print "<h5>%s</h5>" % (page.get("description", ""))
  84. if page.get("date", "") != "":
  85. if page.get("title", "") == "Blog":
  86. if page.get("lang", "en") == "de":
  87. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%d.%m.%Y")
  88. print "<i>Ver&ouml;ffentlicht am %s.</i>" % date
  89. else:
  90. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
  91. print "<i>Published on %s.</i>" % date
  92. else:
  93. if page.get("lang", "en") == "de":
  94. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%d.%m.%Y")
  95. print "<i>Projekt gestartet am %s.</i>" % date
  96. else:
  97. date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
  98. print "<i>Project started on %s.</i>" % date
  99. if page.get("date", "") != "" and page.get("update", "") != "":
  100. print "<br>"
  101. if page.get("update", "") != "":
  102. if page.get("lang", "en") == "de":
  103. date = datetime.strptime(page["update"], "%Y-%m-%d").strftime("%d.%m.%Y")
  104. print "<i>Zuletzt aktualisiert am %s.</i>" % date
  105. else:
  106. date = datetime.strptime(page["update"], "%Y-%m-%d").strftime("%B %d, %Y")
  107. print "<i>Last updated on %s.</i>" % date
  108. link = githubCommitBadge(page, True)
  109. if len(link) > 0:
  110. print "<p>Recent activity on GitHub: " + link + "</p>"
  111. %-->
  112. {{ __content__ }}
  113. <hr>
  114. <!--%
  115. # Comments
  116. if page.get("comments", "false") == "true":
  117. print '<div id="commento"></div>'
  118. print '<hr>'
  119. elif page.get("comments", "false") != "false":
  120. print '<div style="text-align: center;"><a href="%s">Head over here to discuss this article!</a></div>' % page.get("comments", "false")
  121. print '<hr>'
  122. %-->
  123. </div>
  124. <div id="footer">
  125. <a href="https://hg.sr.ht/~obensonne/poole">Poole</a>
  126. &middot;
  127. <a href="http://shjs.sourceforge.net">SHJS</a>
  128. &middot;
  129. <a href="https://github.com/sachinchoolur/lightGallery">lightGallery</a>
  130. &middot;
  131. <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">CC-BY</a>
  132. &middot;
  133. <a href="https://github.com/sponsors/xythobuz">GitHub Sponsors</a>
  134. &middot;
  135. <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>
  136. &middot;
  137. <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_send-money&nav=1&email=xythobuz@me.com">PayPal</a>
  138. </div>
  139. <script type="text/javascript">
  140. function loadPage() {
  141. // adapted from https://sourceforge.net/p/shjs/feature-requests/5/#0940
  142. $("pre[class^='sh_']").each(function() {
  143. // wrap pre with div._sh
  144. $('<div class="_sh"><div class="_sh_lines"></div></div>').insertBefore($(this));
  145. $(this).appendTo($(this).prev('._sh'));
  146. // split content of pre with linebreaks so we can get total line number
  147. var content = $.trim($(this).html());
  148. var lines = content.split('\n');
  149. // append line number to span._sh_lines
  150. for(var line = 1; line < lines.length + 1; line++) {
  151. $(this).prev('._sh_lines').append('<span data-line="' + line + '">' + line + '</span>');
  152. }
  153. });
  154. $("pre:not([class^='sh_']):not([class='ascii'])").each(function() {
  155. // wrap pre with div._sh
  156. $('<div class="_sh"></div>').insertBefore($(this));
  157. $(this).appendTo($(this).prev('._sh'));
  158. });
  159. sh_highlightDocument('/js/sh/', '.min.js');
  160. }
  161. </script>
  162. <script type="text/javascript" src="js/sh_main.js"></script>
  163. <script type="text/javascript" src="js/jquery.min.js"></script>
  164. <!--%
  165. if page.get("comments", "false") == "true":
  166. print '<script defer src="https://comments.xythobuz.de/js/commento.js"></script>'
  167. %-->
  168. <script type="text/javascript">
  169. $(document).ready(function() {
  170. jQuery(window).resize(function() {
  171. $('#wrap').css('height', $('#nav').css('height'));
  172. });
  173. var fontSize = parseInt($('body').css('font-size'), 10);
  174. var initialFontSize = fontSize;
  175. $('.inc').on('click', function() {
  176. fontSize += 1;
  177. $('#content').css('font-size', fontSize + 'px');
  178. })
  179. $('.dec').on('click', function() {
  180. if (fontSize > 1) {
  181. fontSize -= 1;
  182. $('#content').css('font-size', fontSize + 'px');
  183. }
  184. })
  185. $('.reset').on('click', function() {
  186. if (fontSize != initialFontSize) {
  187. fontSize = initialFontSize;
  188. $('#content').css('font-size', initialFontSize + 'px');
  189. }
  190. })
  191. $(document).keypress(function(event) {
  192. if (event.charCode == '+'.charCodeAt(0)) {
  193. fontSize += 1;
  194. $('#content').css('font-size', fontSize + 'px');
  195. }
  196. if (event.charCode == '-'.charCodeAt(0)) {
  197. if (fontSize > 1) {
  198. fontSize -= 1;
  199. $('#content').css('font-size', fontSize + 'px');
  200. }
  201. }
  202. if (event.charCode == '0'.charCodeAt(0)) {
  203. if (fontSize != initialFontSize) {
  204. fontSize = initialFontSize;
  205. $('#content').css('font-size', initialFontSize + 'px');
  206. }
  207. }
  208. });
  209. })
  210. </script>
  211. <script type="text/javascript" src="js/jquery.mousewheel.min.js"></script>
  212. <script type="text/javascript" src="js/lightgallery-all.min.js"></script>
  213. <script type="text/javascript">
  214. $(document).ready(function() {
  215. var lg = document.getElementsByClassName("lightgallery");
  216. for (var i = 0; i < lg.length; i++) {
  217. var settings = {
  218. loadYoutubeThumbnail: true,
  219. youtubeThumbSize: 'mqdefault',
  220. loadVimeoThumbnail: true,
  221. vimeoThumbSize: 'thumbnail_medium',
  222. youtubePlayerParams: {
  223. modestbranding: 1,
  224. showinfo: 0,
  225. rel: 0
  226. },
  227. vimeoPlayerParams: {
  228. byline: 0,
  229. portrait: 0
  230. },
  231. thumbnail:true,
  232. animateThumb: true,
  233. showThumbByDefault: false,
  234. galleryId: i
  235. };
  236. var d = lg.item(i);
  237. if ($(d).find(".border").length > 0) {
  238. settings.selector = '.border';
  239. }
  240. $(d).lightGallery(settings);
  241. }
  242. });
  243. </script>
  244. <script>
  245. var coll = document.getElementsByClassName("collapse");
  246. var i;
  247. for (i = 0; i < coll.length; i++) {
  248. coll[i].addEventListener("click", function() {
  249. this.classList.toggle("collapseactive");
  250. var content = this.nextElementSibling;
  251. if (content.style.maxHeight) {
  252. content.style.maxHeight = null;
  253. setTimeout(function() {
  254. content.style.borderWidth = null;
  255. }, 800);
  256. } else {
  257. content.style.maxHeight = content.scrollHeight + "px";
  258. content.style.borderWidth = "2px";
  259. }
  260. });
  261. }
  262. </script>
  263. <script>
  264. (function(f, a, t, h, o, m){
  265. a[h]=a[h]||function(){
  266. (a[h].q=a[h].q||[]).push(arguments)
  267. };
  268. o=f.createElement('script'),
  269. m=f.getElementsByTagName('script')[0];
  270. o.async=1; o.src=t; o.id='fathom-script';
  271. m.parentNode.insertBefore(o,m)
  272. })(document, window, '//stats.xythobuz.de/tracker.js', 'fathom');
  273. fathom('set', 'siteId', 'APYRK');
  274. fathom('trackPageview');
  275. </script>
  276. </body>
  277. </html>