base.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. {% if 'jinja2.ext.i18n' not in JINJA_ENVIRONMENT.extensions and 'jinja2.ext.i18n' not in JINJA_EXTENSIONS %}
  2. {% macro _(msg) %}
  3. {{ msg % kwargs }}
  4. {% endmacro %}
  5. {% endif %}
  6. <!DOCTYPE html>
  7. <html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}">
  8. <!-- Head -->
  9. <head>
  10. {% block head %}
  11. <!-- Required metadata tags -->
  12. <meta charset="utf-8" />
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  14. <meta name="HandheldFriendly" content="True" />
  15. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  16. <!-- Default metadata -->
  17. {% block meta %}
  18. <meta name="author" content="{{ AUTHOR }}" />
  19. <meta name="description" content="{{ SITEDESCRIPTION }}" />
  20. {% endblock %}
  21. <!-- Site Claim -->
  22. {% if CLAIM_GOOGLE %}
  23. {% include 'includes/claim_google.html' with context %}
  24. {% endif %}
  25. {% if CLAIM_BING %}
  26. {% include 'includes/claim_bing.html' with context %}
  27. {% endif %}
  28. <!-- Title -->
  29. <title>
  30. {% block title %}
  31. {{ SITETITLE }}
  32. {% endblock title %}
  33. </title>
  34. <!-- Icon -->
  35. <link rel="shortcut icon" href="{{ SITEURL }}/favicon.ico" type="image/x-icon">
  36. <link rel="icon" href="{{ SITEURL }}/favicon.ico" type="image/x-icon">
  37. <!-- Search engine -->
  38. {% if page in hidden_pages %}
  39. <meta name="robots" content="noindex, nofollow" />
  40. {% else %}
  41. <meta name="robots" content="{{ ROBOTS }}" />
  42. {% endif %}
  43. <!-- Feeds -->
  44. {% if FEED_ALL_ATOM %}
  45. <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
  46. {% endif %}
  47. {% if FEED_ALL_RSS %}
  48. <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
  49. {% endif %}
  50. {% if FEED_ATOM %}
  51. <link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
  52. {% endif %}
  53. {% if FEED_RSS %}
  54. <link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
  55. {% endif %}
  56. {% if CATEGORY_FEED_ATOM and category %}
  57. <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
  58. {% endif %}
  59. {% if CATEGORY_FEED_RSS and category %}
  60. <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
  61. {% endif %}
  62. {% if TAG_FEED_ATOM and tag %}
  63. <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_ATOM.format(slug=tag.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
  64. {% endif %}
  65. {% if TAG_FEED_RSS and tag %}
  66. <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_RSS.format(slug=tag.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
  67. {% endif %}
  68. <!-- Styles -->
  69. <!--
  70. <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/4.3.1/css/bootstrap.min.css">
  71. -->
  72. <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/bootstrap/bootstrap.min.css">
  73. <!--
  74. <link rel="stylesheet" href="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.css">
  75. -->
  76. {% if article and article.toc == 'show' %}
  77. <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/extra/bootstrap-toc.min.css">
  78. {% endif %}
  79. <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/pygment/friendly.min.css">
  80. <!--
  81. <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/extra/admonition.min.css">
  82. -->
  83. {% if page_name == 'search' %}
  84. <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.css">
  85. {% endif %}
  86. <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/style.css">
  87. <!-- Google Analytics -->
  88. {% if GOOGLE_ANALYTICS %}
  89. {% include "include/ga.html" %}
  90. {% endif %}
  91. <!-- Google Global Site Tag -->
  92. {% if GOOGLE_SITE_TAG %}
  93. {% include "include/gtag.html" %}
  94. {% endif %}
  95. <!-- Google Tag Manager -->
  96. {% if GOOGLE_TAG_MANAGER %}
  97. {% include "include/gtm.html" %}
  98. {% endif %}
  99. <!-- Google Adsense -->
  100. {% if GOOGLE_ADSENSE %}
  101. <script data-ad-client="{{ GOOGLE_ADSENSE.id }}" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  102. {% endif %}
  103. <!-- Heap Analytic -->
  104. {% if HEAP_ANALYTICS %}
  105. {% include "include/ha.html" %}
  106. {% endif %}
  107. <!-- Piwik Tracking -->
  108. {% if PIWIK_SITE_ID and PIWIK_URL %}
  109. {% include "include/piwik.html" %}
  110. {% endif %}
  111. <!-- Matomo Tracking -->
  112. {% if MATOMO_SITENAME %}
  113. {% include "include/matomo.html" %}
  114. {% endif %}
  115. {% endblock head %}
  116. </head>
  117. <!-- Body -->
  118. <body class="d-flex flex-column" data-spy="scroll" data-target="#toc" data-offset="0" style="position: relative;">
  119. <!-- Top anchor -->
  120. <a href="#" id="backToTop" style="display: none; z-index: 1;" title="Back to top"><span></span></a>
  121. <!-- Google tag manager -->
  122. {% if GOOGLE_TAG_MANAGER %}
  123. {% include "include/gtm_noscript.html" %}
  124. {% endif %}
  125. <!-- Navigation -->
  126. <nav class="flex-shrink-0 navbar navbar-expand-md navbar-expand-lg navbar-dark bg-dark text-light shadow-sm">
  127. <!-- Logo -->
  128. <a class="navbar-brand" href="{{ SITEURL }}">{{ SITETITLE }}</a>
  129. <!-- Collapse button -->
  130. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarMenu" aria-controls="navbarMenu" aria-expanded="false" aria-label="Toggle navigation">
  131. <span class="navbar-toggler-icon small"></span>
  132. </button>
  133. <!-- Collapsible content -->
  134. <div class="collapse navbar-collapse" id="navbarMenu">
  135. <!-- i18n subsites -->
  136. {% if extra_siteurls %}
  137. <div class="dropdown">
  138. <button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
  139. <svg class="nav-icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
  140. <path d="M12.87 15.07l-2.54-2.51l.03-.03A17.52 17.52 0 0 0 14.07 6H17V4h-7V2H8v2H1v2h11.17C11.5 7.92 10.44 9.75 9 11.35C8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5l3.11 3.11l.76-2.04M18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12m-2.62 7l1.62-4.33L19.12 17h-3.24z" fill="#626262"/>
  141. </svg>
  142. </button>
  143. <div class="dropdown-menu">
  144. {% for lang, url in lang_siteurls.items() %}
  145. <a class="dropdown-item {% if lang == DEFAULT_LANG %}active{% endif %}" href="{{ url }}/">{{ lang }}</a>
  146. {% endfor %}
  147. </div>
  148. </div>
  149. {% endif %}
  150. <!-- Page links -->
  151. <ul class="navbar-nav mr-auto text-center">
  152. <li class="nav-item {% if page_name == 'index' %} active {% endif %}">
  153. <a class="nav-link" href="{{ SITEURL }}">
  154. <svg class="nav-icon" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24">
  155. <path d="M21 13v10h-6v-6h-6v6h-6v-10h-3l12-12 12 12h-3zm-1-5.907v-5.093h-3v2.093l3 3z" fill="currentColor"></path>
  156. </svg>
  157. Home <span class="sr-only">(current)</span>
  158. </a>
  159. </li>
  160. <li class="nav-item {% if page_name == 'categories' %} active {% endif %}">
  161. <a class="nav-link" href="{{ SITEURL }}/categories.html">
  162. <svg class="nav-icon" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24">
  163. <path d="M16 6h-8v-6h8v6zm-8 12h-8v6h8v-6zm16 0h-8v6h8v-6zm-11-7v-3h-2v3h-8v5h2v-3h14v3h2v-5h-8z" fill="currentColor"></path>
  164. </svg>
  165. Categories
  166. </a>
  167. </li>
  168. <li class="nav-item {% if page_name == 'tags' %} active {% endif %}">
  169. <a class="nav-link" href="{{ SITEURL }}/tags.html">
  170. <svg class="nav-icon" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24">
  171. <path d="M10.605 0h-10.605v10.609l13.391 13.391 10.609-10.604-13.395-13.396zm-4.191 6.414c-.781.781-2.046.781-2.829.001-.781-.783-.781-2.048 0-2.829.782-.782 2.048-.781 2.829-.001.782.782.781 2.047 0 2.829z" fill="currentColor"></path>
  172. </svg>
  173. Tags
  174. </a>
  175. </li>
  176. <li class="nav-item {% if page_name == 'archives' %} active {% endif %}">
  177. <a class="nav-link" href="{{ SITEURL }}/archives.html">
  178. <svg class="nav-icon" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24">
  179. <path d="M1.8 9l-.8-4h22l-.8 4h-2.029l.39-2h-17.122l.414 2h-2.053zm18.575-6l.604-2h-17.979l.688 2h16.687zm3.625 8l-2 13h-20l-2-13h24zm-8 4c0-.552-.447-1-1-1h-6c-.553 0-1 .448-1 1s.447 1 1 1h6c.553 0 1-.448 1-1z" fill="currentColor"></path>
  180. </svg>
  181. Archives
  182. </a>
  183. </li>
  184. <li class="nav-item {% if page and 'about' in page.title|lower %} active {% endif %}">
  185. <a class="nav-link" href="{{ SITEURL }}/pages/about.html">
  186. <svg class="nav-icon" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24">
  187. <path d="M20.822 18.096c-3.439-.794-6.64-1.49-5.09-4.418 4.72-8.912 1.251-13.678-3.732-13.678-5.082 0-8.464 4.949-3.732 13.678 1.597 2.945-1.725 3.641-5.09 4.418-3.073.71-3.188 2.236-3.178 4.904l.004 1h23.99l.004-.969c.012-2.688-.092-4.222-3.176-4.935z" fill="currentColor"></path>
  188. </svg>
  189. About
  190. </a>
  191. </li>
  192. </ul>
  193. {% if page_name != 'search' %}
  194. <!-- Search form -->
  195. <form class="form-inline text-center" action="{{ SITEURL }}/search.html">
  196. <input class="form-control w-100 bg-dark text-light text-center border-0 p-2" type="text" name="q" pattern=".{3,}" title="At least 3 characters" required="" placeholder="Type here to search" aria-label="Search">
  197. </form>
  198. {% endif %}
  199. <!-- Social links -->
  200. <ul class="navbar-nav text-center">
  201. <li class="nav-item">
  202. <a class="nav-link" href="{{ SOCIAL.facebook }}">
  203. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  204. <title>Facebook</title>
  205. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3 8h-1.35c-.538 0-.65.221-.65.778v1.222h2l-.209 2h-1.791v7h-3v-7h-2v-2h2v-2.308c0-1.769.931-2.692 3.029-2.692h1.971v3z" fill="currentColor"></path>
  206. </svg>
  207. </a>
  208. </li>
  209. <li class="nav-item">
  210. <a class="nav-link" href="{{ SOCIAL.github }}">
  211. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  212. <title>Github</title>
  213. <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" fill="currentColor"></path>
  214. </svg>
  215. </a>
  216. </li>
  217. <li class="nav-item">
  218. <a class="nav-link" href="{{ SOCIAL.linkedin }}">
  219. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  220. <title>Linkedin</title>
  221. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-2 16h-2v-6h2v6zm-1-6.891c-.607 0-1.1-.496-1.1-1.109 0-.612.492-1.109 1.1-1.109s1.1.497 1.1 1.109c0 .613-.493 1.109-1.1 1.109zm8 6.891h-1.998v-2.861c0-1.881-2.002-1.722-2.002 0v2.861h-2v-6h2v1.093c.872-1.616 4-1.736 4 1.548v3.359z" fill="currentColor"></path>
  222. </svg>
  223. </a>
  224. </li>
  225. <li class="nav-item">
  226. <a class="nav-link" href="{{ SOCIAL.twitter }}">
  227. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  228. <title>Twitter</title>
  229. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6.066 9.645c.183 4.04-2.83 8.544-8.164 8.544-1.622 0-3.131-.476-4.402-1.291 1.524.18 3.045-.244 4.252-1.189-1.256-.023-2.317-.854-2.684-1.995.451.086.895.061 1.298-.049-1.381-.278-2.335-1.522-2.304-2.853.388.215.83.344 1.301.359-1.279-.855-1.641-2.544-.889-3.835 1.416 1.738 3.533 2.881 5.92 3.001-.419-1.796.944-3.527 2.799-3.527.825 0 1.572.349 2.096.907.654-.128 1.27-.368 1.824-.697-.215.671-.67 1.233-1.263 1.589.581-.07 1.135-.224 1.649-.453-.384.578-.87 1.084-1.433 1.489z" fill="currentColor"></path>
  230. </svg>
  231. </a>
  232. </li>
  233. </ul>
  234. </div>
  235. </nav>
  236. <!-- Full page -->
  237. <div class="flex-shrink-0 flex-grow-1">
  238. {% block page %}
  239. <!-- Header -->
  240. <header class="bg-dark text-light shadow-sm pt-3 pb-2">
  241. {% block header %}{% endblock header %}
  242. </header>
  243. <!-- Main -->
  244. <main class="py-3">
  245. {% block main %}
  246. <div class="container">
  247. <!-- Sharing -->
  248. {% block add_this %}
  249. {% if ADD_THIS_ID and (page_name or page or article) %}
  250. <div class="text-right mb-2 small" style="height: 26px">
  251. <div class="addthis_inline_share_toolbox"></div>
  252. </div>
  253. {% endif %}
  254. {% endblock add_this %}
  255. <!-- Content -->
  256. {% block content %}
  257. {% endblock content %}
  258. </div>
  259. {% endblock main %}
  260. </main>
  261. {% endblock page %}
  262. </div>
  263. <!-- Footer -->
  264. <footer class="flex-shrink-0 bg-dark text-light small py-1">
  265. <div class="container text-center">
  266. &copy; {{ COPYRIGHT_YEAR }} <a href="{{ SITEURL}}">{{ SITENAME }}</a> by <a href="{{ SITEURL }}/pages/about.html">{{ AUTHOR }}</a>. Powered by <a href="http://getpelican.com">Pelican</a>, <a href="http://python.org">Python</a>, <a href="https://getbootstrap.com">Bootstrap 4</a><br>
  267. <!-- Do not remove below license sentence -->
  268. License: <a href="https://spdx.org/licenses/CC-BY-4.0.html">CC-BY-4.0</a>, based on <a href="https://github.com/vuquangtrong/simplify-theme">Simplify Bootstrap Theme</a>
  269. </div>
  270. </footer>
  271. <!-- Scripts -->
  272. <!--
  273. <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script>
  274. -->
  275. <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/jquery/jquery-3.4.1.min.js"></script>
  276. <!--
  277. <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/4.3.1/bootstrap.min.js"></script>
  278. -->
  279. <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/bootstrap/bootstrap.min.js"></script>
  280. <!--
  281. <script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script>
  282. -->
  283. {% if article and article.toc == 'show' %}
  284. <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/extra/bootstrap-toc.min.js"></script>
  285. {% endif %}
  286. {% if page_name == 'search' %}
  287. <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.js"></script>
  288. <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.cfg.js"></script>
  289. <script src="{{ SITEURL }}//tipuesearch_content.js"></script>
  290. <script>
  291. $(document).ready(function() {
  292. $('#tipue_search_input').tipuesearch();
  293. });
  294. </script>
  295. {% endif %}
  296. <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/style.js"></script>
  297. <!-- Sharing -->
  298. {% if ADD_THIS_ID and (page_name or page or article) %}
  299. <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{ ADD_THIS_ID }}"></script>
  300. {% endif %}
  301. <!-- JSON LD -->
  302. {% block jsonld %}
  303. {% if article %}
  304. {% include "include/jsonld_article.html" %}
  305. {% else %}
  306. {% include "include/jsonld.html" %}
  307. {% endif %}
  308. {% endblock jsonld %}
  309. <!-- Disqus count -->
  310. {% block disqus_count %}
  311. {% endblock disqus_count %}
  312. </body>
  313. </html>