jekyll-rtd-theme 1.1.7 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +77 -28
  3. data/_includes/addons/analytics.liquid +6 -13
  4. data/_includes/addons/github.liquid +19 -18
  5. data/_includes/assets/sw.caches.js +38 -28
  6. data/_includes/class/_breadcrumbs.liquid +33 -0
  7. data/_includes/class/_footer.liquid +41 -0
  8. data/_includes/{toctree.liquid → class/_toctree.liquid} +3 -6
  9. data/_includes/class/addons-wrap.liquid +26 -0
  10. data/_includes/class/content-wrap.liquid +20 -0
  11. data/_includes/class/sidebar-wrap.liquid +18 -0
  12. data/_includes/extend/list.liquid +2 -2
  13. data/_includes/extend/toctree.liquid +11 -16
  14. data/_includes/node/custom.liquid +17 -0
  15. data/_includes/node/links.liquid +20 -0
  16. data/_includes/node/metadata.liquid +21 -0
  17. data/_includes/node/script.extension.liquid +29 -0
  18. data/_includes/node/script.liquid +15 -0
  19. data/_includes/node/script.schema.liquid +27 -0
  20. data/_includes/node/title.liquid +1 -0
  21. data/_includes/reset/defaults.liquid +40 -59
  22. data/_includes/reset/i18n.liquid +1 -31
  23. data/_includes/{extend → reset}/tabs.liquid +0 -0
  24. data/_includes/reset/workdir.liquid +1 -15
  25. data/_includes/shortcodes/danger.liquid +9 -0
  26. data/_includes/shortcodes/mermaid.liquid +1 -0
  27. data/_includes/shortcodes/note.liquid +9 -0
  28. data/_includes/shortcodes/tip.liquid +9 -0
  29. data/_includes/shortcodes/warning.liquid +9 -0
  30. data/_layouts/default.liquid +21 -241
  31. data/_layouts/plugins/compress.liquid +13 -10
  32. data/_layouts/plugins/extension.liquid +32 -22
  33. data/_sass/@primer/base/base.scss +90 -0
  34. data/_sass/@primer/base/index.scss +6 -0
  35. data/_sass/@primer/base/kbd.scss +21 -0
  36. data/_sass/@primer/base/normalize.scss +423 -0
  37. data/_sass/@primer/base/typography-base.scss +100 -0
  38. data/_sass/@primer/breadcrumb/breadcrumb.scss +28 -0
  39. data/_sass/@primer/breadcrumb/index.scss +3 -0
  40. data/_sass/@primer/buttons/button-group.scss +91 -0
  41. data/_sass/@primer/buttons/button.scss +296 -0
  42. data/_sass/@primer/buttons/index.scss +4 -0
  43. data/_sass/@primer/buttons/misc.scss +205 -0
  44. data/_sass/@primer/forms/form-control.scss +278 -0
  45. data/_sass/@primer/forms/form-group.scss +279 -0
  46. data/_sass/@primer/forms/form-select.scss +38 -0
  47. data/_sass/@primer/forms/form-validation.scss +369 -0
  48. data/_sass/@primer/forms/index.scss +7 -0
  49. data/_sass/@primer/forms/input-group.scss +53 -0
  50. data/_sass/@primer/forms/radio-group.scss +43 -0
  51. data/_sass/@primer/loaders/index.scss +2 -0
  52. data/_sass/@primer/loaders/loaders.scss +21 -0
  53. data/_sass/@primer/markdown/blob-csv.scss +31 -0
  54. data/_sass/@primer/markdown/code.scss +73 -0
  55. data/_sass/@primer/markdown/headings.scss +72 -0
  56. data/_sass/@primer/markdown/images.scss +131 -0
  57. data/_sass/@primer/markdown/index.scss +8 -0
  58. data/_sass/@primer/markdown/lists.scss +76 -0
  59. data/_sass/@primer/markdown/markdown-body.scss +99 -0
  60. data/_sass/@primer/markdown/tables.scss +38 -0
  61. data/_sass/@primer/support/index.scss +11 -0
  62. data/_sass/@primer/support/mixins/buttons.scss +184 -0
  63. data/_sass/@primer/support/mixins/layout.scss +55 -0
  64. data/_sass/@primer/support/mixins/misc.scss +32 -0
  65. data/_sass/@primer/support/mixins/typography.scss +88 -0
  66. data/_sass/@primer/support/variables/color-system.scss +243 -0
  67. data/_sass/@primer/support/variables/colors.scss +55 -0
  68. data/_sass/@primer/support/variables/layout.scss +149 -0
  69. data/_sass/@primer/support/variables/misc.scss +42 -0
  70. data/_sass/@primer/support/variables/typography.scss +43 -0
  71. data/_sass/@primer/utilities/animations.scss +187 -0
  72. data/_sass/@primer/utilities/borders.scss +184 -0
  73. data/_sass/@primer/utilities/box-shadow.scss +25 -0
  74. data/_sass/@primer/utilities/colors.scss +185 -0
  75. data/_sass/@primer/utilities/details.scss +34 -0
  76. data/_sass/@primer/utilities/flexbox.scss +121 -0
  77. data/_sass/@primer/utilities/index.scss +14 -0
  78. data/_sass/@primer/utilities/layout.scss +134 -0
  79. data/_sass/@primer/utilities/margin.scss +68 -0
  80. data/_sass/@primer/utilities/padding.scss +59 -0
  81. data/_sass/@primer/utilities/typography.scss +325 -0
  82. data/_sass/@primer/utilities/visibility-display.scss +82 -0
  83. data/_sass/_font-face.scss +66 -0
  84. data/_sass/_icons.scss +57 -0
  85. data/_sass/_layout.scss +75 -0
  86. data/_sass/_reset.scss +13 -0
  87. data/_sass/_root.scss +9 -0
  88. data/_sass/_variables.scss +32 -0
  89. data/_sass/class/addons-wrap.scss +39 -0
  90. data/_sass/class/admonition.scss +47 -0
  91. data/_sass/class/container.scss +11 -0
  92. data/_sass/class/content-wrap.scss +4 -0
  93. data/_sass/class/header.scss +10 -0
  94. data/_sass/class/highlight.scss +214 -0
  95. data/_sass/class/markdown-body.scss +68 -0
  96. data/_sass/class/sidebar-wrap.scss +95 -0
  97. data/_sass/class/title.scss +12 -0
  98. data/_sass/theme.scss +31 -0
  99. data/assets/404.liquid +2 -2
  100. data/assets/css/theme.min.css +1 -0
  101. data/assets/css/theme.scss +4 -0
  102. data/assets/js/mermaid.min.js +5 -5
  103. data/assets/js/theme.js +289 -0
  104. data/assets/js/theme.min.js +1 -0
  105. data/assets/search.liquid +4 -20
  106. metadata +93 -53
  107. data/_includes/addons.liquid +0 -28
  108. data/_includes/addons/i18n.liquid +0 -13
  109. data/_includes/addons/plugins.liquid +0 -6
  110. data/_includes/album.liquid +0 -7
  111. data/_includes/assets/common.js +0 -167
  112. data/_includes/assets/search.js +0 -76
  113. data/_includes/breadcrumbs.liquid +0 -43
  114. data/_includes/footer.liquid +0 -39
  115. data/_includes/i18n/en.liquid +0 -29
  116. data/_includes/i18n/es.liquid +0 -29
  117. data/_includes/i18n/fr.liquid +0 -29
  118. data/_includes/i18n/it.liquid +0 -29
  119. data/_includes/i18n/ja.liquid +0 -29
  120. data/_includes/i18n/ko.liquid +0 -29
  121. data/_includes/i18n/ru.liquid +0 -29
  122. data/_includes/i18n/sv.liquid +0 -29
  123. data/_includes/i18n/zh-cn.liquid +0 -29
  124. data/_includes/reset/languages.liquid +0 -110
  125. data/_sass/_album.scss +0 -19
  126. data/_sass/_embed.scss +0 -23
  127. data/_sass/fluid.scss +0 -7
  128. data/_sass/jekyll-rtd-theme.scss +0 -162
  129. data/assets/css/rougify/base16.css +0 -1
  130. data/assets/css/rougify/base16.dark.css +0 -1
  131. data/assets/css/rougify/base16.light.css +0 -1
  132. data/assets/css/rougify/base16.monokai.css +0 -1
  133. data/assets/css/rougify/base16.monokai.dark.css +0 -1
  134. data/assets/css/rougify/base16.monokai.light.css +0 -1
  135. data/assets/css/rougify/base16.solarized.css +0 -1
  136. data/assets/css/rougify/base16.solarized.dark.css +0 -1
  137. data/assets/css/rougify/base16.solarized.light.css +0 -1
  138. data/assets/css/rougify/bw.css +0 -1
  139. data/assets/css/rougify/colorful.css +0 -1
  140. data/assets/css/rougify/github.css +0 -1
  141. data/assets/css/rougify/gruvbox.css +0 -1
  142. data/assets/css/rougify/gruvbox.dark.css +0 -1
  143. data/assets/css/rougify/gruvbox.light.css +0 -1
  144. data/assets/css/rougify/igorpro.css +0 -1
  145. data/assets/css/rougify/magritte.css +0 -1
  146. data/assets/css/rougify/molokai.css +0 -1
  147. data/assets/css/rougify/monokai.css +0 -1
  148. data/assets/css/rougify/monokai.sublime.css +0 -1
  149. data/assets/css/rougify/pastie.css +0 -1
  150. data/assets/css/rougify/thankful_eyes.css +0 -1
  151. data/assets/css/rougify/tulip.css +0 -1
  152. data/assets/css/theme.css +0 -4
  153. data/assets/js/anchor.min.js +0 -9
  154. data/assets/js/html5shiv.min.js +0 -4
@@ -2,15 +2,16 @@
2
2
 
3
3
  {% comment %} display the directory name {% endcomment %}
4
4
  {%- assign dir = site_pages | where: "url", workdir | first -%}
5
- {%- if site_lang != lang -%}
6
- {% comment %} current in language directory (level-1) {% endcomment %}
7
- {%- assign workdir_level = workdir_level | minus: 1 -%}
8
- {%- endif -%}
5
+
9
6
  {%- if workdir_level == 2 %}
10
7
  {% comment %} display the root sub-directory as "p.caption" {% endcomment %}
11
- <p class="caption"><span class="caption-text">{{ dir.title | default: dir.url }}</span></p>
8
+ <a class="caption d-block text-uppercase no-wrap px-2 py-0" href="{{ dir.url | relative_url }}">
9
+ {{ dir.title | default: dir.url }}
10
+ </a>
12
11
  {%- else %}
13
- <a class="reference internal" href="{{ dir.url | relative_url }}">{{ dir.title | default: dir.url }}</a>
12
+ <a class="d-flex flex-items-baseline" href="{{ dir.url | relative_url }}">
13
+ {{ dir.title | default: dir.url }}
14
+ </a>
14
15
  {%- endif -%}
15
16
 
16
17
  <ul>
@@ -20,13 +21,10 @@
20
21
  {%- capture current -%}
21
22
  {%- if page.url == item.url %}current{% endif -%}
22
23
  {%- endcapture %}
23
- {%- if site_lang != lang -%}
24
- {%- assign level = level | minus: 1 -%}
25
- {%- endif -%}
26
24
 
27
- <li class="toctree-l{{ level }} {{ current }}" data-sort="{{ item.sort }}" data-level="{{ level }}">
28
- <a class="reference internal {{ current }}" href="{{ item.url | relative_url }}">
29
- {%- if item.sort and site.show_sorted != false -%}
25
+ <li class="toc level-{{ level }} {{ current }}" data-sort="{{ item.sort }}" data-level="{{ level }}">
26
+ <a class="d-flex flex-items-baseline {{ current }}" href="{{ item.url | relative_url }}">
27
+ {%- if item.sort -%}
30
28
  {{ item.sort }}. {{ item.title | default: item.url }}
31
29
  {%- else -%}
32
30
  {{ item.title | default: item.url }}
@@ -38,9 +36,6 @@
38
36
  {% comment %} list dirs {% endcomment %}
39
37
  {%- for workdir in workdir_dirs -%}
40
38
  {%- assign level = workdir | append: "temp" | replace_first: "/", "" | split: "/" | size | minus: 2 %}
41
- {%- if site_lang != lang -%}
42
- {%- assign level = level | minus: 1 -%}
43
- {%- endif -%}
44
- <li class="toctree-l{{ level }}">{% include extend/toctree.liquid %}</li>
39
+ <li class="toc level-{{ level }}">{% include extend/toctree.liquid %}</li>
45
40
  {%- endfor -%}
46
41
  </ul>
@@ -0,0 +1,17 @@
1
+ {%- capture custom_script -%}
2
+ {%- include assets/custom.js -%}
3
+ {{- site.script -}}
4
+ {%- endcapture -%}
5
+
6
+ {%- capture custom_scss -%}
7
+ {%- include assets/custom.scss -%}
8
+ {{- site.scss -}}
9
+ {%- endcapture -%}
10
+
11
+ {%- if custom_script.size > 0 -%}
12
+ <script>{{ custom_script }}</script>
13
+ {%- endif -%}
14
+
15
+ {%- if custom_scss.size > 0 -%}
16
+ <style>{{ custom_scss | scssify | strip_newlines }}</style>
17
+ {%- endif -%}
@@ -0,0 +1,20 @@
1
+ {%- comment %} dns-prefetch {% endcomment %}
2
+ <link rel="dns-prefetch" href="https://rundocs-analytics.glitch.me">
3
+ <link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
4
+
5
+ {%- comment %} canonical link {% endcomment %}
6
+ <link rel="canonical" href="{{ schema_surl }}">
7
+
8
+ {%- if prev -%}
9
+ <link rel="prev" href="{{ prev.url | absolute_url }}">
10
+ {%- endif -%}
11
+
12
+ {%- if next -%}
13
+ <link rel="next" href="{{ next.url | absolute_url }}">
14
+ {%- endif -%}
15
+
16
+ {% comment %} theme {% endcomment %}
17
+ <link rel="stylesheet" href="{{ cdn }}/assets/css/theme{% if site.debug.dist != false %}.min{% endif %}.css">
18
+
19
+ {% comment %} icon {% endcomment %}
20
+ <link rel="icon" type="image/svg+xml" href="{{ site.baseurl }}/favicon.svg">
@@ -0,0 +1,21 @@
1
+ <meta charset="utf-8">
2
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
3
+ <meta name="description" content="{{ description }}">
4
+ <meta name="revised" content="{{ docs.build_revision }}">
5
+ <meta name="author" content="{{ author }}">
6
+ <meta name="generator" content="jekyll-rtd-theme v{{ version }}">
7
+
8
+ {%- comment %} custom {% endcomment %}
9
+ {% for meta in site.meta -%}
10
+ <meta name="{{ meta.first }}" content="{{ meta.last }}">
11
+ {% endfor -%}
12
+
13
+ {% comment %} https://ogp.me {% endcomment %}
14
+ <meta property="og:title" content="{{ title }}">
15
+ <meta property="og:description" content="{{ description }}">
16
+ <meta property="og:locale" content="{{ lang }}">
17
+ <meta property="og:url" content="{{ schema_surl }}">
18
+ <meta property="og:type" content="article">
19
+ <meta property="article:author" content="{{ author }}">
20
+ <meta property="article:published_time" content="{{ schema_date }}">
21
+ <meta property="article:modified_time" content="{{ schema_modi }}">
@@ -0,0 +1,29 @@
1
+ {%- comment %} mermaid {% endcomment -%}
2
+ {%- if content contains '<code class="language-mermaid">' -%}
3
+ {%- if site.mermaid.custom -%}
4
+ <script src="{{ site.mermaid.custom }}"></script>
5
+ {%- else -%}
6
+ <script src="{{ cdn }}/assets/js/mermaid.min.js"></script>
7
+ {%- endif %}
8
+ <script>
9
+ mermaid.initialize({% if site.mermaid.initialize %}{{ site.mermaid.initialize | jsonify }}{% else %}{}{% endif %});
10
+ </script>
11
+ {%- endif %}
12
+
13
+ {% comment %} Google Analytics {% endcomment %}
14
+ {%- if site.google.gtag -%}
15
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google.gtag }}"></script>
16
+ <script>
17
+ window.dataLayer = window.dataLayer || [];
18
+ function gtag() {
19
+ dataLayer.push(arguments);
20
+ }
21
+ gtag("js", new Date());
22
+ gtag("config", "{{ site.google.gtag }}");
23
+ </script>
24
+ {%- endif -%}
25
+
26
+ {% comment %} Google AdSense {% endcomment %}
27
+ {%- if site.google.adsense -%}
28
+ <script data-ad-client="{{ site.google.adsense }}" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
29
+ {%- endif -%}
@@ -0,0 +1,15 @@
1
+ <script>
2
+ window.ui = {
3
+ title: "{{ site.title }}",
4
+ lang: "{{ lang }}",
5
+ version: "{{ version }}",
6
+ baseurl: "{{ site.baseurl }}",
7
+ i18n: {
8
+ search_results: "{{ __.search_results | default: 'Search Results' }}",
9
+ search_results_found: "{{ __.search_results_found | default: 'Search finished, found # page(s) matching the search query.' }}",
10
+ search_results_not_found: "{{ __.search_results_not_found | default: 'Your search did not match any documents, please make sure that all characters are spelled correctly!' }}"
11
+ }
12
+ };
13
+ </script>
14
+ <script src="{{ cdn }}/assets/js/jquery.min.js"></script>
15
+ <script src="{{ cdn }}/assets/js/theme{% if site.debug.dist != false %}.min{% endif %}.js"></script>
@@ -0,0 +1,27 @@
1
+ <script type="application/ld+json">
2
+ {
3
+ "@context": "https://schema.org",
4
+ "@type": "Article",
5
+ "mainEntityOfPage": {
6
+ "@type": "WebPage",
7
+ "@id": "{{ schema_surl }}"
8
+ },
9
+ "headline": "{{ title }}",
10
+ "image": [{% for image in page.images %}"{{ image }}"{% unless forloop.last %},{% endunless %}{% endfor %}],
11
+ "author": {
12
+ "@type": "Person",
13
+ "name": "{{ author }}"
14
+ },
15
+ "datePublished": "{{ schema_date }}",
16
+ "dateModified": "{{ schema_modi }}",
17
+ "publisher": {
18
+ "@type": "{{ docs.owner.type }}",
19
+ "name": "{{ author }}",
20
+ "logo": {
21
+ "@type": "ImageObject",
22
+ "url": "{{ docs.owner.avatar_url }}"
23
+ }
24
+ },
25
+ "description": "{{ description }}"
26
+ }
27
+ </script>
@@ -0,0 +1 @@
1
+ <title>{{ title }}</title>
@@ -1,88 +1,69 @@
1
- {%- assign description = content | strip_html | split: " " | join: " " | escape | truncate: 150 -%}
2
- {%- assign version = "1.1.7" -%}
3
- {%- assign addons = "github, i18n, plugins, analytics" | split: ", " -%}
1
+ {%- include reset/site_pages.liquid -%}
2
+ {%- include reset/i18n.liquid -%}
4
3
 
5
- {%- assign schema_date = page.date | default: site.time | date_to_xmlschema -%}
6
- {%- assign schema_modi = site.time | date_to_xmlschema -%}
7
- {%- assign schema_surl = page.url | absolute_url | xml_escape -%}
4
+ {%- comment %} variables {% endcomment -%}
5
+ {%- assign version = "2.0.2" -%}
6
+ {%- assign docs = site.github -%}
7
+ {%- assign rest = docs.public_repositories | where: "html_url", docs.repository_url | first -%}
8
8
 
9
- {% comment %} scss {% endcomment %}
10
- {%- capture site_scss -%}
11
- @import "jekyll-rtd-theme.scss";
12
- {% if site.fluid %}@import "fluid.scss";{% endif %}
13
- {% include assets/custom.scss %} {{ site.scss }}
14
- {%- endcapture -%}
9
+ {%- assign rest_created_at = rest.created_at | default: site.time -%}
10
+ {%- assign rest_updated_at = rest.updated_at | default: site.time -%}
15
11
 
16
- {% comment %} cdn {% endcomment %}
17
- {%- if site.debug -%}
18
- {%- assign cdn = site.baseurl -%}
19
- {%- else -%}
20
- {%- assign cdn = "https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@" | append: version -%}
21
- {%- endif -%}
22
-
23
- {% comment %} github-metadata {% endcomment %}
24
- {%- if site.github_metadata != false -%}
25
- {%- assign author = site.author | default: site.github.owner_name -%}
26
- {%- assign branch = site.github.source.branch -%}
27
- {%- assign commit = site.github.build_revision | slice: 0, 7 -%}
28
- {%- assign repository_url = site.github.repository_url -%}
29
- {%- assign issues_url = site.github.issues_url -%}
30
- {%- assign zip_url = site.github.zip_url -%}
31
- {%- capture github_edit_link %}{% github_edit_link %}{% endcapture -%}
32
- {%- else -%}
33
- {%- assign author = site.author -%}
34
- {%- assign branch = "" -%}
35
- {%- assign commit = "" -%}
36
- {%- assign repository_url = "" -%}
37
- {%- assign issues_url = "" -%}
38
- {%- assign zip_url = "" -%}
39
- {%- assign github_edit_link = "" -%}
40
- {%- assign addons = "i18n, plugins, analytics" | split: ", " -%}
41
- {%- endif -%}
12
+ {%- assign lang = site.lang | default: "en" -%}
13
+ {%- assign author = docs.owner.name | default: docs.owner_name -%}
42
14
 
43
- {%- include reset/site_pages.liquid %}
44
- {%- include reset/i18n.liquid -%}
15
+ {%- comment %} schema {% endcomment -%}
16
+ {%- assign schema_date = page.date | default: rest_created_at | date_to_xmlschema -%}
17
+ {%- assign schema_modi = site.time | date_to_xmlschema -%}
18
+ {%- assign schema_surl = page.url | absolute_url | xml_escape -%}
45
19
 
46
- {% comment %} title {% endcomment %}
20
+ {%- comment %} title {% endcomment -%}
47
21
  {%- case page.url -%}
48
22
  {%- when "/" -%}
49
- {%- assign title = site.title | append: " · " | append: site.description -%}
23
+ {%- assign title = site.title | append: " · " | append: site.description | truncate: 110 -%}
50
24
  {%- when "/search.html" -%}
51
- {%- assign title = __search | append: " · " | append: site.title -%}
25
+ {%- assign title = __.search | default: "Search" | append: " · " | append: site.title | truncate: 110 -%}
52
26
  {%- when "/404.html" -%}
53
- {%- assign title = __404 | append: " · " | append: site.title -%}
27
+ {%- assign title = "404" | append: " · " | append: site.title | truncate: 110 -%}
54
28
  {%- else -%}
55
- {%- assign title = page.title | default: page.url | append: " · " | append: site.title -%}
29
+ {%- assign title = page.title | default: page.url | append: " · " | append: site.title | truncate: 110 -%}
56
30
  {%- endcase -%}
57
31
 
32
+ {%- comment %} description {% endcomment -%}
33
+ {%- assign description = content | strip_html | split: " " | join: " " | escape | truncate: 150 -%}
34
+
35
+ {% comment %} debug {% endcomment %}
36
+ {%- if site.debug -%}
37
+ {%- assign cdn = site.baseurl -%}
38
+ {%- else -%}
39
+ {%- assign cdn = "https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@" | append: version -%}
40
+ {%- endif -%}
41
+
58
42
  {% comment %} content {% endcomment %}
59
43
  {%- assign content = content
60
- | replace: '', "'"
61
- | replace: '<pre class="highlight"><code>', '<pre class="notranslate">'
62
- | replace: '<pre><code class="', '<pre class="notranslate '
63
- | replace: "</code></pre>", "</pre>"
64
- | replace: '<code class="language-plaintext highlighter-rouge">', '<code class="literal">'
65
- | replace: "<dl>", '<dl class="definition">'
66
- | replace: "<table>", '<div class="wy-table-responsive"><table class="docutils">'
67
- | replace: "</table>", '</table></div>' -%}
44
+ | replace: "", "'"
45
+ | replace: "", '"'
46
+ | replace: "”", '"'
47
+ | replace: "highlighter-rouge", "highlighter-rouge notranslate" -%}
48
+
68
49
 
69
50
  {% comment %} prev and next {% endcomment %}
70
51
  {%- assign workdir_files = site_files | where_exp: "item", "item.dir == page.dir" -%}
71
52
 
72
- {%- assign _index = 0 -%}
53
+ {%- assign index = 0 -%}
73
54
  {%- for item in workdir_files %}
74
55
  {%- if item.url == page.url %}
75
- {%- assign _index = forloop.index -%}
56
+ {%- assign index = forloop.index -%}
76
57
  {%- endif %}
77
58
  {%- endfor -%}
78
59
 
79
60
  {%- for item in workdir_files -%}
80
- {%- assign _index_prev = _index | minus: 1 -%}
81
- {%- assign _index_next = _index | plus: 1 -%}
82
- {%- if forloop.index == _index_prev -%}
61
+ {%- assign index_prev = index | minus: 1 -%}
62
+ {%- assign index_next = index | plus: 1 -%}
63
+ {%- if forloop.index == index_prev -%}
83
64
  {%- assign prev = item -%}
84
65
  {%- endif %}
85
- {%- if forloop.index == _index_next and page.url != page.dir -%}
66
+ {%- if forloop.index == index_next -%}
86
67
  {%- assign next = item -%}
87
68
  {%- endif %}
88
69
  {%- endfor -%}
@@ -1,31 +1 @@
1
- {%- include reset/languages.liquid -%}
2
-
3
- {% comment %} Set default lang {% endcomment %}
4
- {%- assign site_lang = "en" -%}
5
- {%- if languages contains site.lang -%}
6
- {%- assign site_lang = site.lang -%}
7
- {%- endif -%}
8
-
9
- {% comment %} Get docs all avaiable langs {% endcomment %}
10
- {%- capture langs -%}
11
- {{ site_lang }}|
12
- {%- for item in site_dirs -%}
13
- {%- assign chapter = item.dir | remove_first: "/" | split: "/" | first -%}
14
- {%- if languages contains chapter -%}
15
- {{ chapter }}|
16
- {%- endif -%}
17
- {%- endfor -%}
18
- {%- endcapture -%}
19
- {%- assign site_langs = langs | split: "|" | uniq -%}
20
-
21
- {% comment %} include language by the root subdirectory {% endcomment %}
22
- {%- assign lang = site_lang -%}
23
-
24
- {%- if page.dir != "/" -%}
25
- {%- assign chapter = page.dir | remove_first: "/" | split: "/" | first -%}
26
- {%- if languages contains chapter -%}
27
- {%- assign lang = chapter -%}
28
- {%- endif -%}
29
- {%- endif -%}
30
-
31
- {%- include i18n/{{ lang }}.liquid -%}
1
+ {%- assign __ = site.translate | default: site.data.translate -%}
File without changes
@@ -1,13 +1,5 @@
1
- {% comment %} Start from the language chapter(eg: en-us) or root(/) {% endcomment %}
2
1
  {%- assign workdir = include.workdir | default: "/" -%}
3
2
 
4
- {%- if page.dir != "/" -%}
5
- {%- assign chapter = page.dir | remove_first: "/" | split: "/" | first -%}
6
- {%- if languages contains chapter -%}
7
- {%- capture workdir %}/{{ chapter }}/{% endcapture -%}
8
- {%- endif -%}
9
- {%- endif -%}
10
-
11
3
  {%- assign workdir_level = workdir | append: "temp" | replace_first: "/", "" | split: "/" | size -%}
12
4
  {%- assign workdir_files = site_files | where_exp: "item", "item.dir == workdir" -%}
13
5
 
@@ -19,13 +11,7 @@
19
11
  {%- assign dir = item.dir | replace: workdir, temp | split: "@@" | first -%}
20
12
  {% comment %} In the current subdirectory {% endcomment %}
21
13
  {%- if workdir == dir -%}
22
- {% comment %} Root directory does not display other languages {% endcomment %}
23
- {%- if workdir == "/" -%}
24
- {%- assign language = item.dir | replace: "/", "" -%}
25
- {%- unless languages contains language %}{{ item.dir }}|{% endunless -%}
26
- {%- else -%}
27
- {{ item.dir }}|
28
- {%- endif -%}
14
+ {{ item.dir }}|
29
15
  {%- endif -%}
30
16
  {%- endif -%}
31
17
  {%- endfor -%}
@@ -0,0 +1,9 @@
1
+ <div class="admonition danger mb-3">
2
+ <div class="title px-2 py-1">
3
+ <i class="fa fa-exclamation-circle"></i>
4
+ {{ __.danger | default: "Danger" }}
5
+ </div>
6
+ <div class="content p-2">
7
+ {{ codes | markdownify | strip_newlines -}}
8
+ </div>
9
+ </div>
@@ -0,0 +1 @@
1
+ <div class="mermaid overflow-x-auto">{{ codes }}</div>
@@ -0,0 +1,9 @@
1
+ <div class="admonition note mb-3">
2
+ <div class="title px-2 py-1">
3
+ <i class="fa fa-exclamation-circle"></i>
4
+ {{ __.note | default: "Note" }}
5
+ </div>
6
+ <div class="content p-2">
7
+ {{ codes | markdownify | strip_newlines -}}
8
+ </div>
9
+ </div>
@@ -0,0 +1,9 @@
1
+ <div class="admonition tip mb-3">
2
+ <div class="title px-2 py-1">
3
+ <i class="fa fa-exclamation-circle"></i>
4
+ {{ __.tip | default: "Tip" }}
5
+ </div>
6
+ <div class="content p-2">
7
+ {{ codes | markdownify | strip_newlines -}}
8
+ </div>
9
+ </div>
@@ -0,0 +1,9 @@
1
+ <div class="admonition warning mb-3">
2
+ <div class="title px-2 py-1">
3
+ <i class="fa fa-exclamation-circle"></i>
4
+ {{ __.warning | default: "Warning" }}
5
+ </div>
6
+ <div class="content p-2">
7
+ {{ codes | markdownify | strip_newlines -}}
8
+ </div>
9
+ </div>
@@ -5,245 +5,25 @@ layout: plugins/compress
5
5
  {%- include reset/defaults.liquid -%}
6
6
 
7
7
  <!DOCTYPE html>
8
-
9
- <!--
10
- {% if site.remote_theme -%}
11
- rundocs.io, remote_theme: {{ site.remote_theme }}, based on v{{ version }}
12
- {%- else -%}
13
- rundocs.io, theme: {{ site.theme | default: "jekyll-rtd-theme, based on" }} v{{ version }}
14
- {%- endif %}
15
- -->
16
-
17
- <html class="writer-html5" lang="{{ lang }}">
18
-
19
- <head>
20
- <meta charset="utf-8">
21
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
22
- <meta content="IE=Edge" http-equiv="X-UA-Compatible">
23
- <title>{{ title | truncate: 110 }}</title>
24
- <script>
25
- window.dataLayer = window.dataLayer || [];
26
-
27
- function gtag() {
28
- dataLayer.push(arguments);
29
- }
30
-
31
- function debug() {
32
- console.debug.apply(console, arguments);
33
- }
34
-
35
- gtag("js", new Date());
36
-
37
- if ("serviceWorker" in navigator) {
38
- navigator.serviceWorker.register("{{ site.baseurl }}/sw.caches.js");
39
- } else {
40
- debug("Service Worker not supported!");
41
- }
42
- </script>
43
- <!-- meta -->
44
- <meta name="description" content="{{ description }}">
45
- <meta name="author" content="{{ author }}">
46
- <meta name="revised" content="{{ commit }}">
47
- <meta name="generator" content="jekyll-rtd-theme v{{ version }}">
48
- <!-- meta-ogp -->
49
- {% comment %} https://ogp.me {% endcomment %}
50
- <meta property="og:title" content="{{ title }}">
51
- <meta property="og:description" content="{{ description }}">
52
- <meta property="og:locale" content="{{ lang }}">
53
- <meta property="og:url" content="{{ schema_surl }}">
54
- <meta property="og:type" content="article">
55
- <meta property="article:author" content="{{ author }}">
56
- <meta property="article:published_time" content="{{ schema_date }}">
57
- <meta property="article:modified_time" content="{{ schema_modi }}">
58
- <!-- meta-custom -->
59
- {% for meta in site.meta -%}
60
- <meta name="{{ meta.first }}" content="{{ meta.last }}">
61
- {% endfor -%}
62
- <!-- schema -->
63
- <script type="application/ld+json">
64
- {
65
- "@context": "https://schema.org",
66
- "@type": "Article",
67
- "mainEntityOfPage": {
68
- "@type": "WebPage",
69
- "@id": "{{ schema_surl }}"
70
- },
71
- "headline": "{{ title | truncate: 110 }}",
72
- "image": [{% for image in page.images %}"{{ image }}"{% unless forloop.last %},{% endunless %}{% endfor %}],
73
- "author": {
74
- "@type": "Person",
75
- "name": "{{ author }}"
76
- },
77
- "datePublished": "{{ schema_date }}",
78
- "dateModified": "{{ schema_modi }}",
79
- "publisher": {
80
- "@type": "Organization",
81
- "name": "RunDocs",
82
- "logo": {
83
- "@type": "ImageObject",
84
- "url": "https://rundocs.io/logo.png"
85
- }
86
- },
87
- "description": "{{ description }}"
88
- }
89
- </script>
90
- <!-- link -->
91
- <link rel="canonical" href="{{ schema_surl }}">
92
- {% if prev %}<link rel="prev" href="{{ prev.url | absolute_url }}">{% endif %}
93
- {% if next %}<link rel="next" href="{{ next.url | absolute_url }}">{% endif %}
94
- <!-- theme -->
95
- <link rel="stylesheet" href="{{ cdn }}/assets/css/theme.css">
96
- <link rel="stylesheet" href="{{ cdn }}/assets/css/rougify/{{ site.rougify | default: 'github' }}.css">
97
- <style>{{ site_scss | scssify | strip_newlines }}</style>
98
- <!-- icon -->
99
- <link rel="icon" type="image/svg+xml" href="{{ site.baseurl }}/favicon.svg">
100
- <!-- script -->
101
- <!--[if lt IE 9]><script src="{{ cdn }}/assets/js/html5shiv.min.js"></script><![endif]-->
102
- <script src="{{ cdn }}/assets/js/jquery.min.js"></script>
103
- <script>
104
- const ui = {
105
- baseurl: "{{ site.baseurl }}",
106
- title: "{{ site.title }}",
107
- lang: "{{ lang }}",
108
- admonition: {
109
- note: "{{ __note }}",
110
- tip: "{{ __tip }}",
111
- warning: "{{ __warning }}",
112
- danger: "{{ __danger }}"
113
- }
114
- };
115
- </script>
116
- {% include extra/head.html %}
117
- </head>
118
-
119
- <body class="wy-body-for-nav">
120
- <div class="wy-grid-for-nav">
121
- <!-- NAV -->
122
- <nav data-toggle="wy-nav-shift" class="wy-nav-side">
123
- <div class="wy-side-scroll">
124
- <div class="wy-side-nav-search">
125
- {% if site.logo %}
126
- <a href="{{ site.baseurl }}/{% if site_lang != lang %}{{ lang }}/{% endif %}">
127
- <img src="{{ site.baseurl }}/{{ site.logo }}" class="logo" alt="{{ site.title }}">
128
- </a>
129
- {% else %}
130
- <a href="{{ site.baseurl }}/{% if site_lang != lang %}{{ lang }}/{% endif %}" class="icon icon-home"> {{ site.title }}</a>
131
- {% endif %}
132
- {% if site.nav_version and site.github_metadata != false %}
133
- <div class="version">{{ site.github.latest_release.name }}</div>
134
- {% endif %}
135
- <div role="search">
136
- <form id="rtd-search-form" class="wy-form" action="{{ site.baseurl }}/search.html" method="get" autocomplete="off">
137
- <input type="text" name="q" placeholder="{{ __search_docs }}...">
138
- <input type="hidden" name="lang" value="{{ lang }}">
139
- </form>
140
- </div>
141
- </div>
142
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">{% include toctree.liquid %}</div>
143
- {%- if site.embed -%}
144
- <div class="wy-embed-wrap"><div class="wy-embed">{{ site.embed }}</div></div>
145
- {%- endif -%}
146
- </div>
147
- </nav>
148
-
149
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
150
- <!-- MOBILE NAV -->
151
- <nav class="wy-nav-top" aria-label="top navigation">
152
- <div class="flex">
153
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
154
- <div class="wy-nav-title">
155
- <a href="{{ site.baseurl }}/{% if site_lang != lang %}{{ lang }}/{% endif %}">{{ site.title }}</a>
156
- </div>
157
- </div>
158
- </nav>
159
- <div class="wy-nav-content">
160
- <div class="rst-content">
161
- {% include breadcrumbs.liquid %}
162
- <div role="main" itemscope="itemscope" itemtype="http://schema.org/Article">
163
- <div class="document" itemprop="articleBody">
164
- {%- if page.url == "/search.html" -%}
165
- {{ content }}
166
- {%- else -%}
167
- <div class="section">{{ content }}</div>
168
- {%- endif -%}
169
- </div>
170
- {% comment %} comments {% endcomment %}
171
- {% if site.disqus %}
172
- <div id="disqus_thread" class="articleComments"></div>
173
- <script>
174
- (function(script) {
175
- script.src = "https://{{ site.disqus }}.disqus.com/embed.js";
176
- script.setAttribute("data-timestamp", +new Date());
177
- document.head.appendChild(script);
178
- })(document.createElement("script"));
179
- </script>
180
- {% endif %}
181
- </div>
182
- {% include footer.liquid %}
183
- </div>
184
- </div>
185
- </section>
186
- </div>
187
- {%- if site.addons %}{% include addons.liquid %}{% endif %}
188
- {% include extra/footer.html %}
189
- <!-- script -->
190
- <script src="{{ cdn }}/assets/js/anchor.min.js"></script>
191
-
192
- {% comment %} mermaid {% endcomment %}
193
- {%- if content contains '<pre class="notranslate language-mermaid">' -%}
194
- {%- if site.mermaid.custom -%}
195
- <script src="{{ site.mermaid.custom }}"></script>
196
- {%- else -%}
197
- <script src="{{ cdn }}/assets/js/mermaid.min.js"></script>
198
- {%- endif %}
199
- <script>
200
- mermaid.initialize({% if site.mermaid.initialize %}{{ site.mermaid.initialize | jsonify }}{% else %}{}{% endif %});
201
- </script>
202
- {%- endif %}
203
- <script>
204
- {% include assets/common.js %}
205
- {% include assets/custom.js %} {{ site.script }}
206
- </script>
207
-
208
- {% comment %} Baidu link submit {% endcomment %}
209
- {%- if site.baidu.linksubmit -%}
210
- <script>
211
- (function(script) {
212
- script.src = "https://zz.bdstatic.com/linksubmit/push.js";
213
- document.head.appendChild(script);
214
- })(document.createElement("script"));
215
- </script>
216
- {%- endif -%}
217
-
218
- {% comment %} Baidu Analytics {% endcomment %}
219
- {%- if site.baidu.hm -%}
220
- <script>
221
- var _hmt = _hmt || [];
222
- (function(script) {
223
- script.src = "https://hm.baidu.com/hm.js?{{ site.baidu.hm }}";
224
- document.head.appendChild(script);
225
- })(document.createElement("script"));
226
- </script>
227
- {%- endif -%}
228
-
229
- {% comment %} CNZZ Analytics {% endcomment %}
230
- {%- if site.cnzz -%}
231
- <span id="cnzz_stat_icon_{{ site.cnzz }}" style="display: none;"></span>
232
- <script async src="https://v1.cnzz.com/z_stat.php?id={{ site.cnzz }}"></script>
233
- {%- endif -%}
234
-
235
- {% comment %} Google Analytics {% endcomment %}
236
- {%- if site.google.gtag -%}
237
- <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google.gtag }}"></script>
238
- <script>
239
- gtag("config", "{{ site.google.gtag }}");
240
- </script>
241
- {%- endif -%}
242
-
243
- {% comment %} Google AdSense {% endcomment %}
244
- {%- if site.google.adsense -%}
245
- <script data-ad-client="{{ site.google.adsense }}" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
246
- {%- endif -%}
247
- </body>
248
-
8
+ <html lang="{{ lang }}">
9
+ <head>
10
+ {%- include node/metadata.liquid -%}
11
+
12
+ {%- include node/title.liquid -%}
13
+ {%- include node/links.liquid -%}
14
+
15
+ {%- include node/script.schema.liquid -%}
16
+
17
+ {%- include extra/head.html -%}
18
+ </head>
19
+ <body class="container">
20
+ {%- include class/sidebar-wrap.liquid -%}
21
+ {%- include class/content-wrap.liquid -%}
22
+ {%- include class/addons-wrap.liquid -%}
23
+
24
+ {%- include node/script.liquid -%}
25
+ {%- include node/custom.liquid -%}
26
+ {%- include node/script.extension.liquid -%}
27
+ {%- include extra/footer.html -%}
28
+ </body>
249
29
  </html>