jekyll-rtd-theme 1.1.7 → 2.0.0.pre.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -9
  3. data/_includes/addons/analytics.liquid +5 -12
  4. data/_includes/addons/github.liquid +16 -18
  5. data/_includes/assets/sw.caches.js +38 -28
  6. data/_includes/breadcrumbs.liquid +20 -36
  7. data/_includes/extend/toctree.liquid +6 -15
  8. data/_includes/footer.liquid +29 -32
  9. data/_includes/reset/defaults.liquid +3 -37
  10. data/_includes/reset/workdir.liquid +1 -14
  11. data/_includes/safe/shortcodes.liquid +9 -0
  12. data/_includes/shortcodes/danger.liquid +7 -0
  13. data/_includes/shortcodes/mermaid.liquid +1 -0
  14. data/_includes/shortcodes/note.liquid +7 -0
  15. data/_includes/shortcodes/tip.liquid +7 -0
  16. data/_includes/shortcodes/warning.liquid +7 -0
  17. data/_includes/toctree.liquid +2 -5
  18. data/_layouts/default.liquid +90 -147
  19. data/_layouts/plugins/compress.liquid +13 -10
  20. data/_layouts/plugins/extension.liquid +30 -22
  21. data/_sass/@primer/base/base.scss +90 -0
  22. data/_sass/@primer/base/index.scss +6 -0
  23. data/_sass/@primer/base/kbd.scss +21 -0
  24. data/_sass/@primer/base/normalize.scss +423 -0
  25. data/_sass/@primer/base/typography-base.scss +100 -0
  26. data/_sass/@primer/breadcrumb/breadcrumb.scss +28 -0
  27. data/_sass/@primer/breadcrumb/index.scss +3 -0
  28. data/_sass/@primer/buttons/button-group.scss +91 -0
  29. data/_sass/@primer/buttons/button.scss +296 -0
  30. data/_sass/@primer/buttons/index.scss +4 -0
  31. data/_sass/@primer/buttons/misc.scss +205 -0
  32. data/_sass/@primer/forms/form-control.scss +278 -0
  33. data/_sass/@primer/forms/form-group.scss +279 -0
  34. data/_sass/@primer/forms/form-select.scss +38 -0
  35. data/_sass/@primer/forms/form-validation.scss +369 -0
  36. data/_sass/@primer/forms/index.scss +7 -0
  37. data/_sass/@primer/forms/input-group.scss +53 -0
  38. data/_sass/@primer/forms/radio-group.scss +43 -0
  39. data/_sass/@primer/markdown/blob-csv.scss +31 -0
  40. data/_sass/@primer/markdown/code.scss +73 -0
  41. data/_sass/@primer/markdown/headings.scss +72 -0
  42. data/_sass/@primer/markdown/images.scss +131 -0
  43. data/_sass/@primer/markdown/index.scss +8 -0
  44. data/_sass/@primer/markdown/lists.scss +76 -0
  45. data/_sass/@primer/markdown/markdown-body.scss +99 -0
  46. data/_sass/@primer/markdown/tables.scss +38 -0
  47. data/_sass/@primer/support/index.scss +11 -0
  48. data/_sass/@primer/support/mixins/buttons.scss +184 -0
  49. data/_sass/@primer/support/mixins/layout.scss +55 -0
  50. data/_sass/@primer/support/mixins/misc.scss +32 -0
  51. data/_sass/@primer/support/mixins/typography.scss +88 -0
  52. data/_sass/@primer/support/variables/color-system.scss +243 -0
  53. data/_sass/@primer/support/variables/colors.scss +55 -0
  54. data/_sass/@primer/support/variables/layout.scss +149 -0
  55. data/_sass/@primer/support/variables/misc.scss +42 -0
  56. data/_sass/@primer/support/variables/typography.scss +43 -0
  57. data/_sass/@primer/utilities/animations.scss +187 -0
  58. data/_sass/@primer/utilities/borders.scss +184 -0
  59. data/_sass/@primer/utilities/box-shadow.scss +25 -0
  60. data/_sass/@primer/utilities/colors.scss +185 -0
  61. data/_sass/@primer/utilities/details.scss +34 -0
  62. data/_sass/@primer/utilities/flexbox.scss +121 -0
  63. data/_sass/@primer/utilities/index.scss +14 -0
  64. data/_sass/@primer/utilities/layout.scss +134 -0
  65. data/_sass/@primer/utilities/margin.scss +68 -0
  66. data/_sass/@primer/utilities/padding.scss +59 -0
  67. data/_sass/@primer/utilities/typography.scss +325 -0
  68. data/_sass/@primer/utilities/visibility-display.scss +82 -0
  69. data/_sass/_font-face.scss +65 -0
  70. data/_sass/_icons.scss +53 -0
  71. data/_sass/_layout.scss +76 -0
  72. data/_sass/_reset.scss +21 -0
  73. data/_sass/_root.scss +9 -0
  74. data/_sass/_variables.scss +29 -0
  75. data/_sass/class/addons-wrap.scss +39 -0
  76. data/_sass/class/container.scss +11 -0
  77. data/_sass/class/content-wrap.scss +4 -0
  78. data/_sass/class/header.scss +10 -0
  79. data/_sass/class/highlight.scss +214 -0
  80. data/_sass/class/markdown-body.scss +49 -0
  81. data/_sass/class/sidebar-wrap.scss +72 -0
  82. data/_sass/class/title.scss +13 -0
  83. data/_sass/theme.scss +29 -0
  84. data/assets/404.liquid +2 -4
  85. data/assets/css/theme.min.css +1 -0
  86. data/assets/css/theme.scss +4 -0
  87. data/assets/js/mermaid.min.js +6 -5
  88. data/assets/js/search.js +90 -0
  89. data/assets/js/theme.js +228 -0
  90. data/assets/js/theme.min.js +1 -0
  91. data/assets/search.liquid +5 -12
  92. metadata +79 -56
  93. data/_includes/addons.liquid +0 -28
  94. data/_includes/addons/i18n.liquid +0 -13
  95. data/_includes/addons/plugins.liquid +0 -6
  96. data/_includes/album.liquid +0 -7
  97. data/_includes/assets/common.js +0 -167
  98. data/_includes/assets/custom.js +0 -0
  99. data/_includes/assets/custom.scss +0 -0
  100. data/_includes/assets/search.js +0 -76
  101. data/_includes/extra/footer.html +0 -0
  102. data/_includes/extra/head.html +0 -0
  103. data/_includes/i18n/en.liquid +0 -29
  104. data/_includes/i18n/es.liquid +0 -29
  105. data/_includes/i18n/fr.liquid +0 -29
  106. data/_includes/i18n/it.liquid +0 -29
  107. data/_includes/i18n/ja.liquid +0 -29
  108. data/_includes/i18n/ko.liquid +0 -29
  109. data/_includes/i18n/ru.liquid +0 -29
  110. data/_includes/i18n/sv.liquid +0 -29
  111. data/_includes/i18n/zh-cn.liquid +0 -29
  112. data/_includes/reset/i18n.liquid +0 -31
  113. data/_includes/reset/languages.liquid +0 -110
  114. data/_sass/_album.scss +0 -19
  115. data/_sass/_embed.scss +0 -23
  116. data/_sass/fluid.scss +0 -7
  117. data/_sass/jekyll-rtd-theme.scss +0 -162
  118. data/assets/css/rougify/base16.css +0 -1
  119. data/assets/css/rougify/base16.dark.css +0 -1
  120. data/assets/css/rougify/base16.light.css +0 -1
  121. data/assets/css/rougify/base16.monokai.css +0 -1
  122. data/assets/css/rougify/base16.monokai.dark.css +0 -1
  123. data/assets/css/rougify/base16.monokai.light.css +0 -1
  124. data/assets/css/rougify/base16.solarized.css +0 -1
  125. data/assets/css/rougify/base16.solarized.dark.css +0 -1
  126. data/assets/css/rougify/base16.solarized.light.css +0 -1
  127. data/assets/css/rougify/bw.css +0 -1
  128. data/assets/css/rougify/colorful.css +0 -1
  129. data/assets/css/rougify/github.css +0 -1
  130. data/assets/css/rougify/gruvbox.css +0 -1
  131. data/assets/css/rougify/gruvbox.dark.css +0 -1
  132. data/assets/css/rougify/gruvbox.light.css +0 -1
  133. data/assets/css/rougify/igorpro.css +0 -1
  134. data/assets/css/rougify/magritte.css +0 -1
  135. data/assets/css/rougify/molokai.css +0 -1
  136. data/assets/css/rougify/monokai.css +0 -1
  137. data/assets/css/rougify/monokai.sublime.css +0 -1
  138. data/assets/css/rougify/pastie.css +0 -1
  139. data/assets/css/rougify/thankful_eyes.css +0 -1
  140. data/assets/css/rougify/tulip.css +0 -1
  141. data/assets/css/theme.css +0 -4
  142. data/assets/js/anchor.min.js +0 -9
  143. data/assets/js/html5shiv.min.js +0 -4
@@ -0,0 +1,9 @@
1
+ {%- capture safe_list -%}
2
+ mermaid
3
+ note
4
+ tip
5
+ warning
6
+ danger
7
+ {%- endcapture -%}
8
+
9
+ {%- assign shortcodes = safe_list | split: " " -%}
@@ -0,0 +1,7 @@
1
+ <div class="admonition danger">
2
+ <p class="admonition-title" ui="danger">
3
+ <i class="fas fa-exclamation-circle"></i>
4
+ <span class="progress"></span>
5
+ </p>
6
+ {{ codes | markdownify | strip_newlines -}}
7
+ </div>
@@ -0,0 +1 @@
1
+ <div class="mermaid overflow-x-auto">{{ codes }}</div>
@@ -0,0 +1,7 @@
1
+ <div class="admonition note">
2
+ <p class="admonition-title" ui="note">
3
+ <i class="fas fa-exclamation-circle"></i>
4
+ <span class="progress"></span>
5
+ </p>
6
+ {{ codes | markdownify | strip_newlines -}}
7
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="admonition tip">
2
+ <p class="admonition-title" ui="tip">
3
+ <i class="fas fa-exclamation-circle"></i>
4
+ <span class="progress"></span>
5
+ </p>
6
+ {{ codes | markdownify | strip_newlines -}}
7
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="admonition warning">
2
+ <p class="admonition-title" ui="warning">
3
+ <i class="fas fa-exclamation-circle"></i>
4
+ <span class="progress"></span>
5
+ </p>
6
+ {{ codes | markdownify | strip_newlines -}}
7
+ </div>
@@ -4,14 +4,11 @@
4
4
  <ul>
5
5
  {%- for item in workdir_files -%}
6
6
  {%- assign level = item.dir | append: "temp" | replace_first: "/", "" | split: "/" | size -%}
7
- {%- if site_lang != lang -%}
8
- {%- assign level = level | minus: 1 -%}
9
- {%- endif -%}
10
7
  {%- capture current -%}
11
8
  {%- if page.url == item.url %}current{% endif -%}
12
9
  {%- endcapture %}
13
- <li class="toctree-l{{ level }} {{ current }}" data-sort="{{ item.sort }}" data-level="{{ level }}">
14
- <a class="reference internal {{ current }}" href="{{ item.url | relative_url }}">
10
+ <li class="toc level-{{ level }} {{ current }}" data-sort="{{ item.sort }}" data-level="{{ level }}">
11
+ <a class="d-flex {{ current }}" href="{{ item.url | relative_url }}">
15
12
  {%- if item.sort and site.show_sorted != false -%}
16
13
  {{ item.sort }}. {{ item.title | default: item.url }}
17
14
  {%- else -%}
@@ -5,54 +5,26 @@ 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 }}">
8
+ <html lang="{{ site.lang }}">
18
9
 
19
10
  <head>
20
11
  <meta charset="utf-8">
21
12
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
22
13
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">
23
14
  <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
15
  <!-- meta -->
44
16
  <meta name="description" content="{{ description }}">
45
- <meta name="author" content="{{ author }}">
46
- <meta name="revised" content="{{ commit }}">
17
+ <meta name="author" content="{{ site.github.owner_name }}">
18
+ <meta name="revised" content="{{ site.github.build_revision }}">
47
19
  <meta name="generator" content="jekyll-rtd-theme v{{ version }}">
48
20
  <!-- meta-ogp -->
49
21
  {% comment %} https://ogp.me {% endcomment %}
50
22
  <meta property="og:title" content="{{ title }}">
51
23
  <meta property="og:description" content="{{ description }}">
52
- <meta property="og:locale" content="{{ lang }}">
24
+ <meta property="og:locale" content="{{ site.lang }}">
53
25
  <meta property="og:url" content="{{ schema_surl }}">
54
26
  <meta property="og:type" content="article">
55
- <meta property="article:author" content="{{ author }}">
27
+ <meta property="article:author" content="{{ site.github.owner_name }}">
56
28
  <meta property="article:published_time" content="{{ schema_date }}">
57
29
  <meta property="article:modified_time" content="{{ schema_modi }}">
58
30
  <!-- meta-custom -->
@@ -72,7 +44,7 @@ layout: plugins/compress
72
44
  "image": [{% for image in page.images %}"{{ image }}"{% unless forloop.last %},{% endunless %}{% endfor %}],
73
45
  "author": {
74
46
  "@type": "Person",
75
- "name": "{{ author }}"
47
+ "name": "{{ site.github.owner_name }}"
76
48
  },
77
49
  "datePublished": "{{ schema_date }}",
78
50
  "dateModified": "{{ schema_modi }}",
@@ -92,105 +64,107 @@ layout: plugins/compress
92
64
  {% if prev %}<link rel="prev" href="{{ prev.url | absolute_url }}">{% endif %}
93
65
  {% if next %}<link rel="next" href="{{ next.url | absolute_url }}">{% endif %}
94
66
  <!-- 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>
67
+ <link rel="stylesheet" href="{{ cdn }}/assets/css/theme{% if site.debug.dist != false %}.min{% endif %}.css">
98
68
  <!-- icon -->
99
69
  <link rel="icon" type="image/svg+xml" href="{{ site.baseurl }}/favicon.svg">
100
70
  <!-- 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
71
  <script>
104
- const ui = {
72
+ window.ui = {
105
73
  baseurl: "{{ site.baseurl }}",
106
74
  title: "{{ site.title }}",
107
- lang: "{{ lang }}",
108
75
  admonition: {
109
76
  note: "{{ __note }}",
110
77
  tip: "{{ __tip }}",
111
78
  warning: "{{ __warning }}",
112
79
  danger: "{{ __danger }}"
113
- }
80
+ },
81
+ lang: "{{ site.lang }}",
82
+ version: "{{ version }}"
114
83
  };
115
84
  </script>
116
- {% include extra/head.html %}
85
+ <!-- script -->
86
+ <script src="{{ cdn }}/assets/js/jquery.min.js"></script>
87
+ <script src="{{ cdn }}/assets/js/theme{% if site.debug.dist != false %}.min{% endif %}.js"></script>
88
+
117
89
  </head>
118
90
 
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>
91
+ <body class="container">
92
+ <div class="sidebar-wrap overflow-hidden">
93
+ <div class="sidebar d-flex flex-column height-full overflow-y-scroll overflow-x-hidden">
94
+ <div class="header d-flex flex-column p-3 text-center">
95
+ <div class="title pb-1 no-underline">
96
+ <a class="h4 py-1 px-2 rounded-1" href="{{ site.baseurl }}/">
97
+ {% if site.logo %}
98
+ <img class="logo" src="{{ site.baseurl }}/{{ site.logo }}" alt="{{ site.title }}">
99
+ {% else %}
100
+ <i class="fa fa-home"></i> {{ site.title }}
101
+ {% endif %}
102
+ </a>
141
103
  </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 -%}
104
+ <span class="version text-gray">{{ site.github.latest_release.name }}</span>
105
+ <form class="search pt-2" action="{{ site.baseurl }}/search.html" method="get" autocomplete="off">
106
+ <input class="form-control input-block input-sm" type="text" name="q" placeholder="{{ site.data.translate.search_docs | default: 'Search docs' }}...">
107
+ </form>
146
108
  </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>
109
+ <div class="toctree py-2" data-spy="affix" role="navigation" aria-label="main navigation">
110
+ {% include toctree.liquid %}
111
+ </div>
112
+ <div class="embed-wrap">
113
+ <div class="embed p-2 m-3 rounded-2 text-blue bg-white">
114
+ {{ site.embed }}
157
115
  </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 %}
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <div class="content-wrap">
120
+ <div class="header d-flex flex-justify-between p-2 hide-lg hide-xl" aria-label="top navigation">
121
+ <button id="toggle" class="btn-octicon p-2 m-0 text-white" type="button">
122
+ <i class="fa fa-bars"></i>
123
+ </button>
124
+ <div class="title flex-1 no-underline d-flex flex-justify-center">
125
+ <a class="h4 py-1 px-2 rounded-1" href="{{ site.baseurl }}/">{{ site.title }}</a>
126
+ </div>
127
+ </div>
128
+ <div class="content p-5">
129
+ {% include breadcrumbs.liquid %}
130
+ <hr>
131
+ <div role="main" itemscope="itemscope" itemtype="http://schema.org/Article">
132
+ <div class="markdown-body" itemprop="articleBody">
133
+ {{ content }}
183
134
  </div>
184
135
  </div>
185
- </section>
136
+ {% include footer.liquid %}
137
+ </div>
138
+ </div>
139
+ <div class="addons-wrap d-flex flex-column overflow-y-auto">
140
+ <div class="status d-flex flex-justify-between p-2">
141
+ <div class="title p-1">
142
+ <i class="fa fa-book"></i> {{ site.title }}
143
+ </div>
144
+ <div class="branch p-1">
145
+ <span class="name">
146
+ {{ site.github.source.branch }}
147
+ </span>
148
+ <i class="fa fa-caret-down"></i>
149
+ </div>
150
+ </div>
151
+ <div class="addons d-flex flex-column height-full p-2 d-none">
152
+ {%- assign items = "github, analytics" | split: ", " -%}
153
+ {% for item in items -%}
154
+ {% include addons/{{ item }}.liquid %}
155
+ {% endfor -%}
156
+ <hr>
157
+ <div class="generator f6 pb-2">
158
+ Built with
159
+ <a href="https://github.com/rundocs/jekyll-rtd-theme" target="_blank" title="{% if site.remote_theme %}remote{% endif %} theme v{{ version }}">jekyll-rtd-theme</a>
160
+ provided by
161
+ <a href="https://rundocs.io" target="_blank">RunDocs</a>
162
+ </div>
163
+ </div>
186
164
  </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
165
 
192
- {% comment %} mermaid {% endcomment %}
193
- {%- if content contains '<pre class="notranslate language-mermaid">' -%}
166
+ {%- comment %} mermaid {% endcomment -%}
167
+ {%- if content contains '<code class="language-mermaid">' -%}
194
168
  {%- if site.mermaid.custom -%}
195
169
  <script src="{{ site.mermaid.custom }}"></script>
196
170
  {%- else -%}
@@ -200,50 +174,19 @@ layout: plugins/compress
200
174
  mermaid.initialize({% if site.mermaid.initialize %}{{ site.mermaid.initialize | jsonify }}{% else %}{}{% endif %});
201
175
  </script>
202
176
  {%- 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
177
 
235
178
  {% comment %} Google Analytics {% endcomment %}
236
179
  {%- if site.google.gtag -%}
237
180
  <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google.gtag }}"></script>
238
181
  <script>
182
+ window.dataLayer = window.dataLayer || [];
183
+ function gtag() {
184
+ dataLayer.push(arguments);
185
+ }
186
+ gtag("js", new Date());
239
187
  gtag("config", "{{ site.google.gtag }}");
240
188
  </script>
241
189
  {%- 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
190
  </body>
248
191
 
249
192
  </html>
@@ -5,14 +5,17 @@ layout: plugins/extension
5
5
  {%- if site.debug.compress == false -%}
6
6
  {{ content }}
7
7
  {%- else -%}
8
- {%- assign blocks = content | split: "<pre" -%}
9
- {%- for block in blocks -%}
10
- {%- assign child_blocks = block | split: "</pre>" -%}
11
- {%- if child_blocks.size == 1 -%}
12
- {{ block | split: " " | join: " " }}
13
- {%- else -%}
14
- {%- comment %} current nested pre not support {% endcomment -%}
15
- <pre{{ child_blocks.first }}</pre> {{ child_blocks.last | split: " " | join: " " -}}
16
- {%- endif -%}
17
- {%- endfor -%}
8
+ {%- if content contains "<pre" -%}
9
+ {%- assign content_blocks = content | split: "<pre" -%}
10
+ {%- for content_block in content_blocks -%}
11
+ {%- if content_block contains "</pre>" -%}
12
+ {%- assign pre_blocks = content_block | split: "</pre>" -%}
13
+ <pre{{ pre_blocks.first }}</pre> {{ pre_blocks.last | split: " " | join: " " -}}
14
+ {%- else -%}
15
+ {{- content_block | split: " " | join: " " -}}
16
+ {%- endif -%}
17
+ {%- endfor -%}
18
+ {%- else -%}
19
+ {{- content | split: " " | join: " " -}}
20
+ {%- endif -%}
18
21
  {%- endif -%}
@@ -1,24 +1,32 @@
1
- {%- assign blocks = content | split: "<pre" -%}
2
- {%- for block in blocks -%}
3
- {%- assign child_blocks = block | split: "</pre>" %}
4
- {%- if child_blocks.size == 1 -%}
5
- {{ block }}
6
- {%- else -%}
7
- {%- comment %} admonitions card {% endcomment -%}
8
- {%- assign admonitions = "note, tip, warning, danger" | split: ", " -%}
9
- {%- comment %} get pre code and type {% endcomment -%}
10
- {%- assign pre_blocks = child_blocks.first | replace_first: ">", "```<temp>```" | split: "```<temp>```" -%}
11
- {%- assign pre_type = pre_blocks.first | replace: '"', '' | replace: " class=notranslate language-", "" -%}
1
+ {%- include safe/shortcodes.liquid -%}
12
2
 
13
- {%- if admonitions contains pre_type -%}
14
- <div class="admonition {{ pre_type }}">
15
- {%- comment %} title will be translated via ui {% endcomment -%}
16
- <p class="admonition-title" ui="{{ pre_type }}"><span class="progress"></span></p>{{ pre_blocks.last | markdownify | strip_newlines -}}
17
- </div>{{ child_blocks.last -}}
18
- {%- elsif pre_type == "mermaid" -%}
19
- <div class="mermaid">{{ pre_blocks.last }}</div>{{ child_blocks.last }}
20
- {%- else -%}
21
- <pre{{ child_blocks.first }}</pre> {{ child_blocks.last -}}
22
- {%- endif -%}
3
+ {%- if site.debug.extension == false -%}
4
+ {{ content }}
5
+ {%- else -%}
6
+ {%- if content contains "<pre" -%}
7
+ {%- assign content_blocks = content | split: "<pre" -%}
8
+ {%- for content_block in content_blocks -%}
9
+ {%- if content_block contains "</pre>" -%}
10
+ {%- assign pre_blocks = content_block | split: "</pre>" -%}
11
+ {%- if content_block contains '><code class="language-' -%}
12
+ {%- comment %} shortcodes: <pre><code class="language-**"> {% endcomment -%}
13
+ {%- assign custom = content_block | replace_first: '><code class="language-', "" | replace_first: '">', "<temp/>" | split: "<temp/>" -%}
14
+ {%- assign lang = custom.first -%}
15
+ {%- assign codes = custom.last | split: "</code>" | first -%}
16
+ {%- assign others = custom.last | split: "</code>" | last -%}
17
+ {%- if shortcodes contains lang -%}
18
+ {%- include shortcodes/{{ lang }}.liquid -%} {{- others -}}
19
+ {%- else -%}
20
+ <pre{{ pre_blocks.first }}</pre> {{ pre_blocks.last }}
21
+ {%- endif -%}
22
+ {%- else -%}
23
+ <pre{{ pre_blocks.first }}</pre> {{ pre_blocks.last -}}
24
+ {%- endif -%}
25
+ {%- else -%}
26
+ {{- content_block -}}
27
+ {%- endif -%}
28
+ {%- endfor -%}
29
+ {%- else -%}
30
+ {{- content -}}
23
31
  {%- endif -%}
24
- {%- endfor -%}
32
+ {%- endif -%}