base.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. {% import "partials/language.html" as lang with context %}
  2. {% set feature = config.theme.feature %}
  3. {% set palette = config.theme.palette %}
  4. {% set font = config.theme.font %}
  5. <!doctype html>
  6. <html lang="{{ lang.t('language') }}" class="no-js">
  7. <head>
  8. {% block site_meta %}
  9. <meta charset="utf-8">
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <meta http-equiv="x-ua-compatible" content="ie=edge">
  12. {% if page and page.meta and page.meta.description %}
  13. <meta name="description" content="{{ page.meta.description }}">
  14. {% elif config.site_description %}
  15. <meta name="description" content="{{ config.site_description }}">
  16. {% endif %}
  17. {% if page and page.meta and page.meta.redirect %}
  18. <script>var anchor=window.location.hash.substr(1);location.href="{{ page.meta.redirect }}"+(anchor?"#"+anchor:"")</script>
  19. <meta http-equiv="refresh" content="0; url={{ page.meta.redirect }}">
  20. <meta name="robots" content="noindex">
  21. <link rel="canonical" href="{{ page.meta.redirect }}">
  22. {% elif page.canonical_url %}
  23. <link rel="canonical" href="{{ page.canonical_url }}">
  24. {% endif %}
  25. {% if page and page.meta and page.meta.author %}
  26. <meta name="author" content="{{ page.meta.author | first }}">
  27. {% elif config.site_author %}
  28. <meta name="author" content="{{ config.site_author }}">
  29. {% endif %}
  30. {% for key in [
  31. "clipboard.copy",
  32. "clipboard.copied",
  33. "search.language",
  34. "search.pipeline.stopwords",
  35. "search.pipeline.trimmer",
  36. "search.result.none",
  37. "search.result.one",
  38. "search.result.other",
  39. "search.tokenizer"
  40. ] %}
  41. <meta name="lang:{{ key }}" content="{{ lang.t(key) }}">
  42. {% endfor %}
  43. <link rel="shortcut icon" href="{{ config.theme.favicon | url }}">
  44. <meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-4.2.0">
  45. {% endblock %}
  46. {% block htmltitle %}
  47. {% if page and page.meta and page.meta.title %}
  48. <title>{{ page.meta.title }}</title>
  49. {% elif page and page.title and not page.is_homepage %}
  50. <title>{{ page.title }} - {{ config.site_name }}</title>
  51. {% else %}
  52. <title>{{ config.site_name }}</title>
  53. {% endif %}
  54. {% endblock %}
  55. {% block styles %}
  56. <link rel="stylesheet" href="{{ 'assets/stylesheets/application.668e8dde.css' | url }}">
  57. {% if palette.primary or palette.accent %}
  58. <link rel="stylesheet" href="{{ 'assets/stylesheets/application-palette.224b79ff.css' | url }}">
  59. {% endif %}
  60. {% if palette.primary %}
  61. {% import "partials/palette.html" as map %}
  62. {% set primary = map.primary(
  63. palette.primary | replace(" ", "-") | lower
  64. ) %}
  65. <meta name="theme-color" content="{{ primary }}">
  66. {% endif %}
  67. {% endblock %}
  68. {% block libs %}
  69. <script src="{{ 'assets/javascripts/modernizr.74668098.js' | url }}"></script>
  70. {% endblock %}
  71. {% block fonts %}
  72. {% if font != false %}
  73. <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
  74. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family={{
  75. font.text | replace(' ', '+') + ':300,400,400i,700|' +
  76. font.code | replace(' ', '+')
  77. }}">
  78. <style>body,input{font-family:"{{ font.text }}","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"{{ font.code }}","Courier New",Courier,monospace}</style>
  79. {% endif %}
  80. {% endblock %}
  81. <link rel="stylesheet" href="{{ 'assets/fonts/material-icons.css' | url }}">
  82. {% if config.extra.manifest %}
  83. <link rel="manifest" href="{{ config.extra.manifest | url }}">
  84. {% endif %}
  85. {% for path in config["extra_css"] %}
  86. <link rel="stylesheet" href="{{ path | url }}">
  87. {% endfor %}
  88. {% block analytics %}
  89. {% if config.google_analytics %}
  90. {% include "partials/integrations/analytics.html" %}
  91. {% endif %}
  92. {% endblock %}
  93. {% block extrahead %}{% endblock %}
  94. </head>
  95. {% if palette.primary or palette.accent %}
  96. {% set primary = palette.primary | replace(" ", "-") | lower %}
  97. {% set accent = palette.accent | replace(" ", "-") | lower %}
  98. <body dir="{{ lang.t('direction') }}" data-md-color-primary="{{ primary }}" data-md-color-accent="{{ accent }}">
  99. {% else %}
  100. <body dir="{{ lang.t('direction') }}">
  101. {% endif %}
  102. <svg class="md-svg">
  103. <defs>
  104. {% set platform = config.extra.repo_icon or config.repo_url %}
  105. {% if "github" in platform %}
  106. {% include "assets/images/icons/github.f0b8504a.svg" %}
  107. {% elif "gitlab" in platform %}
  108. {% include "assets/images/icons/gitlab.6dd19c00.svg" %}
  109. {% elif "bitbucket" in platform %}
  110. {% include "assets/images/icons/bitbucket.1b09e088.svg" %}
  111. {% endif %}
  112. </defs>
  113. </svg>
  114. <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
  115. <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
  116. <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
  117. {% if page.toc | first is defined %}
  118. <a href="{{ (page.toc | first).url }}" tabindex="1" class="md-skip">
  119. {{ lang.t('skip.link.title') }}
  120. </a>
  121. {% endif %}
  122. {% block header %}
  123. {% include "partials/header.html" %}
  124. {% endblock %}
  125. <div class="md-container">
  126. {% block hero %}
  127. {% if page and page.meta and page.meta.hero %}
  128. {% include "partials/hero.html" with context %}
  129. {% endif %}
  130. {% endblock %}
  131. {% if feature.tabs %}
  132. {% include "partials/tabs.html" %}
  133. {% endif %}
  134. <main class="md-main">
  135. <div class="md-main__inner md-grid" data-md-component="container">
  136. {% block site_nav %}
  137. {% if nav %}
  138. <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
  139. <div class="md-sidebar__scrollwrap">
  140. <div class="md-sidebar__inner">
  141. {% include "partials/nav.html" %}
  142. </div>
  143. </div>
  144. </div>
  145. {% endif %}
  146. {% if page.toc %}
  147. <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
  148. <div class="md-sidebar__scrollwrap">
  149. <div class="md-sidebar__inner">
  150. {% include "partials/toc.html" %}
  151. </div>
  152. </div>
  153. </div>
  154. {% endif %}
  155. {% endblock %}
  156. <div class="md-content">
  157. <article class="md-content__inner md-typeset">
  158. {% block content %}
  159. {% if page.edit_url %}
  160. <a href="{{ page.edit_url }}" title="{{ lang.t('edit.link.title') }}" class="md-icon md-content__icon">&#xE3C9;</a>
  161. {% endif %}
  162. {% if not "\x3ch1" in page.content %}
  163. <h1>{{ page.title | default(config.site_name, true)}}</h1>
  164. {% endif %}
  165. {{ page.content }}
  166. {% block source %}
  167. {% if page and page.meta and page.meta.source %}
  168. <h2 id="__source">{{ lang.t("meta.source") }}</h2>
  169. {% set repo = config.repo_url %}
  170. {% if repo | last == "/" %}
  171. {% set repo = repo[:-1] %}
  172. {% endif %}
  173. {% set path = page.meta.path | default([""]) %}
  174. {% set file = page.meta.source %}
  175. <a href="{{ [repo, path, file] | join('/') }}" title="{{ file }}" class="md-source-file">
  176. {{ file }}
  177. </a>
  178. {% endif %}
  179. {% endblock %}
  180. {% endblock %}
  181. {% block disqus %}
  182. {% include "partials/integrations/disqus.html" %}
  183. {% endblock %}
  184. </article>
  185. </div>
  186. </div>
  187. </main>
  188. {% block footer %}
  189. {% include "partials/footer.html" %}
  190. {% endblock %}
  191. </div>
  192. {% block scripts %}
  193. <script src="{{ 'assets/javascripts/application.81068b3a.js' | url }}"></script>
  194. {% if lang.t("search.language") != "en" %}
  195. {% set languages = lang.t("search.language").split(",") %}
  196. {% if languages | length and languages[0] != "" %}
  197. {% set path = "assets/javascripts/lunr/" %}
  198. <script src="{{ (path ~ 'lunr.stemmer.support.js') | url }}"></script>
  199. {% for language in languages | map("trim") %}
  200. {% if language != "en" %}
  201. {% if language == "ja" %}
  202. <script src="{{ (path ~ 'tinyseg.js') | url }}"></script>
  203. {% endif %}
  204. {% if language in ("da", "de", "es", "fi", "fr", "hu", "it", "ja", "nl", "no", "pt", "ro", "ru", "sv", "th", "tr") %}
  205. <script src="{{ (path ~ 'lunr.' ~ language ~ '.js') | url }}"></script>
  206. {% endif %}
  207. {% endif %}
  208. {% endfor %}
  209. {% if languages | length > 1 %}
  210. <script src="{{ (path ~ 'lunr.multi.js') | url }}"></script>
  211. {% endif %}
  212. {% endif %}
  213. {% endif %}
  214. <script>app.initialize({version:"{{ mkdocs_version }}",url:{base:"{{ base_url }}"}})</script>
  215. {% for path in config["extra_javascript"] %}
  216. <script src="{{ path | url }}"></script>
  217. {% endfor %}
  218. {% endblock %}
  219. </body>
  220. </html>