dev-jekyll-theme 1.0.0

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 (108) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +28 -0
  4. data/_data/assets/cross_origin.yml +62 -0
  5. data/_data/assets/self_host.yml +51 -0
  6. data/_data/authors.yml +12 -0
  7. data/_data/contact.yml +30 -0
  8. data/_data/locales/bg-BG.yml +83 -0
  9. data/_data/locales/cs-CZ.yml +91 -0
  10. data/_data/locales/de-DE.yml +82 -0
  11. data/_data/locales/en.yml +93 -0
  12. data/_data/locales/es-ES.yml +79 -0
  13. data/_data/locales/fr-FR.yml +79 -0
  14. data/_data/locales/hu-HU.yml +81 -0
  15. data/_data/locales/id-ID.yml +79 -0
  16. data/_data/locales/ko-KR.yml +86 -0
  17. data/_data/locales/my-MM.yml +79 -0
  18. data/_data/locales/pt-BR.yml +79 -0
  19. data/_data/locales/ru-RU.yml +79 -0
  20. data/_data/locales/tr-TR.yml +79 -0
  21. data/_data/locales/uk-UA.yml +79 -0
  22. data/_data/locales/vi-VN.yml +77 -0
  23. data/_data/locales/zh-CN.yml +85 -0
  24. data/_data/share.yml +27 -0
  25. data/_includes/assets-origin.html +12 -0
  26. data/_includes/comments/disqus.html +54 -0
  27. data/_includes/comments/giscus.html +56 -0
  28. data/_includes/comments/utterances.html +51 -0
  29. data/_includes/comments.html +5 -0
  30. data/_includes/datetime.html +15 -0
  31. data/_includes/embed/twitch.html +4 -0
  32. data/_includes/embed/youtube.html +6 -0
  33. data/_includes/favicons.html +17 -0
  34. data/_includes/footer.html +36 -0
  35. data/_includes/google-analytics.html +14 -0
  36. data/_includes/head.html +115 -0
  37. data/_includes/js-selector.html +99 -0
  38. data/_includes/jsdelivr-combine.html +32 -0
  39. data/_includes/language-alias.html +70 -0
  40. data/_includes/mermaid.html +59 -0
  41. data/_includes/mode-toggle.html +129 -0
  42. data/_includes/no-linenos.html +10 -0
  43. data/_includes/post-nav.html +30 -0
  44. data/_includes/post-paginator.html +88 -0
  45. data/_includes/post-sharing.html +26 -0
  46. data/_includes/read-time.html +30 -0
  47. data/_includes/refactor-content.html +330 -0
  48. data/_includes/related-posts.html +103 -0
  49. data/_includes/search-loader.html +46 -0
  50. data/_includes/search-results.html +11 -0
  51. data/_includes/sidebar.html +104 -0
  52. data/_includes/toc.html +16 -0
  53. data/_includes/topbar.html +70 -0
  54. data/_includes/trending-tags.html +50 -0
  55. data/_includes/update-list.html +40 -0
  56. data/_layouts/archives.html +34 -0
  57. data/_layouts/categories.html +118 -0
  58. data/_layouts/category.html +22 -0
  59. data/_layouts/compress.html +10 -0
  60. data/_layouts/default.html +71 -0
  61. data/_layouts/home.html +94 -0
  62. data/_layouts/page.html +63 -0
  63. data/_layouts/post.html +141 -0
  64. data/_layouts/tag.html +21 -0
  65. data/_layouts/tags.html +23 -0
  66. data/_sass/addon/commons.scss +1744 -0
  67. data/_sass/addon/module.scss +163 -0
  68. data/_sass/addon/syntax.scss +275 -0
  69. data/_sass/addon/variables.scss +30 -0
  70. data/_sass/colors/dark-syntax.scss +87 -0
  71. data/_sass/colors/dark-typography.scss +171 -0
  72. data/_sass/colors/light-syntax.scss +83 -0
  73. data/_sass/colors/light-typography.scss +105 -0
  74. data/_sass/dev-jekyll-theme.scss +24 -0
  75. data/_sass/layout/archives.scss +136 -0
  76. data/_sass/layout/categories.scss +66 -0
  77. data/_sass/layout/category-tag.scss +73 -0
  78. data/_sass/layout/home.scss +178 -0
  79. data/_sass/layout/post.scss +387 -0
  80. data/_sass/layout/tags.scss +19 -0
  81. data/_sass/variables-hook.scss +3 -0
  82. data/assets/404.html +14 -0
  83. data/assets/css/style.scss +12 -0
  84. data/assets/feed.xml +61 -0
  85. data/assets/img/favicons/android-chrome-192x192.png +0 -0
  86. data/assets/img/favicons/android-chrome-512x512.png +0 -0
  87. data/assets/img/favicons/apple-touch-icon.png +0 -0
  88. data/assets/img/favicons/browserconfig.xml +13 -0
  89. data/assets/img/favicons/favicon-16x16.png +0 -0
  90. data/assets/img/favicons/favicon-32x32.png +0 -0
  91. data/assets/img/favicons/favicon.ico +0 -0
  92. data/assets/img/favicons/mstile-150x150.png +0 -0
  93. data/assets/img/favicons/safari-pinned-tab.svg +15 -0
  94. data/assets/img/favicons/site.webmanifest +26 -0
  95. data/assets/js/data/search.json +20 -0
  96. data/assets/js/data/swcache.js +54 -0
  97. data/assets/js/dist/categories.min.js +6 -0
  98. data/assets/js/dist/commons.min.js +6 -0
  99. data/assets/js/dist/home.min.js +6 -0
  100. data/assets/js/dist/misc.min.js +6 -0
  101. data/assets/js/dist/page.min.js +6 -0
  102. data/assets/js/dist/post.min.js +6 -0
  103. data/assets/js/dist/pvreport.min.js +6 -0
  104. data/assets/js/pwa/app.js +47 -0
  105. data/assets/js/pwa/sw.js +90 -0
  106. data/assets/js/pwa/unregister.js +12 -0
  107. data/assets/robots.txt +10 -0
  108. metadata +242 -0
@@ -0,0 +1,330 @@
1
+ <!--
2
+ Refactor the HTML structure.
3
+ -->
4
+
5
+ {% assign _content = include.content %}
6
+
7
+ <!--
8
+ In order to allow a wide table to scroll horizontally,
9
+ we suround the markdown table with `<div class="table-wrapper">` and `</div>`
10
+ -->
11
+
12
+ {% if _content contains '<table' %}
13
+ {% assign _content = _content
14
+ | replace: '<table', '<div class="table-wrapper"><table'
15
+ | replace: '</table>', '</table></div>'
16
+ | replace: '<code><div class="table-wrapper">', '<code>'
17
+ | replace: '</table></div></code>', '</table></code>'
18
+ %}
19
+ {% endif %}
20
+
21
+ <!--
22
+ Fixed kramdown code highlight rendering:
23
+ https://github.com/penibelst/jekyll-compress-html/issues/101
24
+ https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
25
+ -->
26
+
27
+ {% if _content contains '<pre class="highlight">' %}
28
+ {% assign _content = _content
29
+ | replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code'
30
+ | replace: '</code></pre></div>', '</code></div>'
31
+ %}
32
+ {% endif %}
33
+
34
+ <!-- Change the icon of checkbox -->
35
+ {% if _content contains '<input type="checkbox"' %}
36
+ {% assign _content = _content
37
+ | replace:
38
+ '<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" checked="checked" />',
39
+ '<i class="fas fa-check-circle fa-fw checked"></i>'
40
+ | replace:
41
+ '<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />',
42
+ '<i class="far fa-circle fa-fw"></i>'
43
+ %}
44
+ {% endif %}
45
+
46
+ <!-- images -->
47
+
48
+ {% assign IMG_TAG = '<img ' %}
49
+
50
+ {% if _content contains IMG_TAG %}
51
+ {% assign _img_content = nil %}
52
+ {% assign _img_snippets = _content | split: IMG_TAG %}
53
+
54
+ <!-- CDN URL -->
55
+ {% if site.img_cdn %}
56
+ {% if site.img_cdn contains '//' %}
57
+ {% assign _path_prefix = site.img_cdn %}
58
+ {% else %}
59
+ {% assign _path_prefix = site.img_cdn | relative_url %}
60
+ {% endif %}
61
+ {% else %}
62
+ {% assign _path_prefix = site.baseurl %}
63
+ {% endif %}
64
+
65
+ <!-- Add image path -->
66
+ {% if page.img_path %}
67
+ {% assign _path = page.img_path | append: '/' | replace: '//', '/' %}
68
+ {% assign _path_prefix = _path_prefix | append: _path %}
69
+ {% endif %}
70
+
71
+ {% for _img_snippet in _img_snippets %}
72
+ {% if forloop.first %}
73
+ {% assign _img_content = _img_snippet %}
74
+ {% continue %}
75
+ {% endif %}
76
+
77
+ {% assign _left = _img_snippet | split: '>' | first %}
78
+ {% assign _right = _img_snippet | remove: _left %}
79
+
80
+ {% unless _left contains 'src=' %}
81
+ {% continue %}
82
+ {% endunless %}
83
+
84
+ {% assign _left = _left | remove: ' /' | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
85
+ {% assign _attrs = _left | split: '" ' %}
86
+
87
+ {% assign _width = nil %}
88
+ {% assign _height = nil %}
89
+ {% assign _lqip = nil %}
90
+ {% assign _class = nil %}
91
+
92
+ {% for _attr in _attrs %}
93
+ {% unless _attr contains '=' %}
94
+ {% continue %}
95
+ {% endunless %}
96
+
97
+ {% assign _pair = _attr | remove: '"' | split: '=' %}
98
+ {% capture _key %}{{ _pair | first }}{% endcapture %}
99
+ {% capture _value %}{{ _pair | last }}{% endcapture %}
100
+
101
+ {% case _key %}
102
+ {% when 'width' %}
103
+ {% assign _width = _value %}
104
+ {% when 'height' %}
105
+ {% assign _height = _value %}
106
+ {% when 'src' %}
107
+ {% assign _src = _value %}
108
+ {% when 'lqip' %}
109
+ {% assign _lqip = _value %}
110
+ {% when 'class' %}
111
+ {% assign _class = _value %}
112
+ {% endcase %}
113
+
114
+ {% endfor %}
115
+
116
+ <!-- take out classes -->
117
+ {% if _class %}
118
+ {% capture _old_class %}class="{{ _class }}"{% endcapture %}
119
+ {% assign _left = _left | remove: _old_class %}
120
+ {% endif %}
121
+
122
+ {% assign _final_src = nil %}
123
+
124
+ {% unless _src contains '//' %}
125
+ {% assign _final_src = _path_prefix | append: _src %}
126
+ {% capture _src_from %}"{{ _src }}"{% endcapture %}
127
+ {% capture _src_to %}"{{ _final_src }}"{% endcapture %}
128
+ {% assign _left = _left | replace: _src_from, _src_to %}
129
+ {% endunless %}
130
+
131
+ {% if _lqip %}
132
+ {% unless _lqip contains ':' %}
133
+ {% assign _final_lqip = _path_prefix | append: _lqip %}
134
+ {% capture _lqip_from %}"{{ _lqip }}"{% endcapture %}
135
+ {% capture _lqip_to %}"{{ _final_lqip }}"{% endcapture %}
136
+ {% assign _left = _left | replace: _lqip_from, _lqip_to %}
137
+ {% endunless %}
138
+ {% endif %}
139
+
140
+ <!-- lazy-load images <https://github.com/aFarkas/lazysizes#readme> -->
141
+ {% assign _left = _left | replace: 'src=', 'data-src=' %}
142
+ {% if _left contains 'class=' %}
143
+ {% assign _left = _left | replace: 'class="', 'class="lazyload '%}
144
+ {% else %}
145
+ {% assign _left = _left | append: ' class="lazyload"' %}
146
+ {% endif %}
147
+
148
+ <!-- add image placeholder -->
149
+ {% if _lqip %}
150
+ {% assign _left = _left | replace: ' lqip=', ' data-lqip="true" src=' %}
151
+ {% else %}
152
+ {% if _width and _height %}
153
+ <!-- add SVG placehoder -->
154
+ {%- capture _svg -%}
155
+ src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E"
156
+ {%- endcapture -%}
157
+ {% assign _left = _svg | append: ' ' | append: _left %}
158
+ {% assign _class = _class | append: ' shimmer' %}
159
+ {% endif %}
160
+ {% endif %}
161
+
162
+ <!-- Bypass the HTML-proofer test -->
163
+ {% assign _left = _left | append: ' data-proofer-ignore' %}
164
+
165
+ <!-- make sure the `<img>` is wrapped by `<a>` -->
166
+ {% assign _parent = _right | slice: 1, 4 %}
167
+
168
+ {% if _parent == '</a>' %}
169
+ <!-- add class to exist <a> tag -->
170
+ {% assign _size = _img_content | size | minus: 1 %}
171
+ {% capture _class %}
172
+ class="img-link{% unless _lqip %} shimmer{% endunless %}"
173
+ {% endcapture %}
174
+ {% assign _img_content = _img_content | slice: 0, _size | append: _class | append: '>' %}
175
+
176
+ {% else %}
177
+ <!-- create the image wrapper -->
178
+ {%- capture _wrapper_start -%}
179
+ <a href="{{ _final_src | default: _src }}" class="popup img-link {{ _class }}">
180
+ {%- endcapture -%}
181
+ {% assign _img_content = _img_content | append: _wrapper_start %}
182
+ {% assign _right = _right | prepend: '></a' %}
183
+ {% endif %}
184
+
185
+ <!-- combine -->
186
+ {% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %}
187
+
188
+ {% endfor %}
189
+
190
+ {% if _img_content %}
191
+ {% assign _content = _img_content %}
192
+ {% endif %}
193
+
194
+ {% endif %}
195
+
196
+ <!-- Add header for code snippets -->
197
+
198
+ {% if _content contains '<div class="highlight"><code>' %}
199
+ {% assign _code_spippets = _content | split: '<div class="highlight"><code>' %}
200
+ {% assign _new_content = '' %}
201
+
202
+ {% for _snippet in _code_spippets %}
203
+
204
+ {% if forloop.last %}
205
+ {% assign _new_content = _new_content | append: _snippet %}
206
+
207
+ {% else %}
208
+
209
+ {% assign _left = _snippet | split: '><' | last%}
210
+
211
+ {% if _left contains 'file="' %}
212
+ {% assign _label_text = _left | split: 'file="' | last | split: '"' | first %}
213
+ {% assign _label_icon = 'far fa-file-code' %}
214
+ {% else %}
215
+ {% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
216
+ {% capture _label_text %}{% include language-alias.html language=_lang %}{% endcapture %}
217
+ {% assign _label_icon = 'fas fa-code small' %}
218
+ {% endif %}
219
+
220
+ {% capture _label %}
221
+ <span data-label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
222
+ {% endcapture %}
223
+
224
+ {% assign _new_content = _new_content | append: _snippet
225
+ | append: '<div class="code-header">'
226
+ | append: _label
227
+ | append: '<button aria-label="copy" data-title-succeed="'
228
+ | append: site.data.locales[site.lang].post.button.copy_code.succeed
229
+ | append: '"><i class="far fa-clipboard"></i></button></div>'
230
+ | append: '<div class="highlight"><code>'
231
+ %}
232
+
233
+ {% endif %}
234
+
235
+ {% endfor %}
236
+
237
+ {% assign _content = _new_content %}
238
+
239
+ {% endif %}
240
+
241
+ <!-- Create heading anchors -->
242
+
243
+ {% assign heading_levels = '2,3,4,5' | split: ',' %}
244
+ {% assign _heading_content = _content %}
245
+
246
+ {% for level in heading_levels %}
247
+ {% capture mark_start %}<h{{ level }} id="{% endcapture %}
248
+ {% capture mark_end %}</h{{ level }}>{% endcapture %}
249
+
250
+ {% if _heading_content contains mark_start %}
251
+ {% assign _new_content = nil %}
252
+ {% assign heading_snippets = _heading_content | split: mark_start %}
253
+
254
+ {% for snippet in heading_snippets %}
255
+ {% if forloop.first %}
256
+ {% assign _new_content = snippet %}
257
+ {% continue %}
258
+ {% endif %}
259
+
260
+ {% assign id = snippet | split: '"' | first %}
261
+ {% capture anchor %}<a href="#{{ id }}" class="anchor text-muted"><i class="fas fa-hashtag"></i></a>{% endcapture %}
262
+
263
+ {% assign left = snippet | split: mark_end | first %}
264
+ {% assign right = snippet | slice: left.size, snippet.size %}
265
+ {% assign left = left | replace_first: '">', '"><span class="mr-2">' | append: '</span>' %}
266
+
267
+ {% assign _new_content = _new_content | append: mark_start
268
+ | append: left | append: anchor | append: right
269
+ %}
270
+
271
+ {% endfor %}
272
+
273
+ {% assign _heading_content = _new_content %}
274
+
275
+ {% endif %}
276
+ {% endfor %}
277
+
278
+ {% assign _content = _heading_content %}
279
+
280
+ <!-- Wrap prompt element of blockquote with the <div> tag -->
281
+
282
+ {% assign blockquote_start = '<blockquote class=' %}
283
+ {% assign blockquote_end = '</blockquote>' %}
284
+ {% assign cls_prefix = 'prompt-' %}
285
+
286
+ {% if _content contains blockquote_start %}
287
+
288
+ {% assign _prompt_content = nil %}
289
+ {% assign _prompt_snippets = _content | split: blockquote_start %}
290
+
291
+ {% for _snippet in _prompt_snippets %}
292
+
293
+ {% if forloop.first %}
294
+ {% assign _prompt_content = _snippet %}
295
+ {% continue %}
296
+ {% endif %}
297
+
298
+ {% assign left = _snippet | split: blockquote_end | first %}
299
+ {% assign right = _snippet | slice: left.size, _snippet.size %}
300
+
301
+ {% assign cls_str = left | split: '>' | first %}
302
+ {% assign cls_array = cls_str | remove: '"' | split: ' ' %}
303
+ {% assign is_prompt = false %}
304
+
305
+ {% for cls in cls_array %}
306
+ {% if cls contains cls_prefix %}
307
+ {% assign is_prompt = true %}
308
+ {% break %}
309
+ {% endif %}
310
+ {% endfor %}
311
+
312
+ {% unless is_prompt %}
313
+ {% assign _prompt_content = _prompt_content | append: blockquote_start | append: _snippet %}
314
+ {% continue %}
315
+ {% endunless %}
316
+
317
+ {% assign left = left | slice: cls_str.size, left.size %}
318
+ {% assign left = cls_str | append: '><div' | append: left | append: '</div>' %}
319
+
320
+ {% assign _prompt_content = _prompt_content | append: blockquote_start | append: left | append: right %}
321
+
322
+ {% endfor %}
323
+
324
+ {% assign _content = _prompt_content %}
325
+
326
+ {% endif %}
327
+
328
+ <!-- return -->
329
+
330
+ {{ _content }}
@@ -0,0 +1,103 @@
1
+ <!--
2
+ Recommend the other 3 posts according to the tags and categories of the current post,
3
+ if the number is not enough, use the other latest posts to supplement.
4
+ -->
5
+
6
+ <!-- The total size of related posts -->
7
+ {% assign TOTAL_SIZE = 3 %}
8
+
9
+ <!-- An random integer that bigger than 0 -->
10
+ {% assign TAG_SCORE = 1 %}
11
+
12
+ <!-- Equals to TAG_SCORE / {max_categories_hierarchy} -->
13
+ {% assign CATEGORY_SCORE = 0.5 %}
14
+
15
+ {% assign SEPARATOR = ":" %}
16
+
17
+ {% assign score_list = "" | split: "" %}
18
+ {% assign last_index = site.posts.size | minus: 1 %}
19
+
20
+ {% for i in (0..last_index) %}
21
+ {% assign post = site.posts[i] %}
22
+
23
+ {% if post.url == page.url %}
24
+ {% continue %}
25
+ {% endif %}
26
+
27
+ {% assign score = 0 %}
28
+
29
+ {% for tag in post.tags %}
30
+ {% if page.tags contains tag %}
31
+ {% assign score = score | plus: TAG_SCORE %}
32
+ {% endif %}
33
+ {% endfor %}
34
+
35
+ {% for category in post.categories %}
36
+ {% if page.categories contains category %}
37
+ {% assign score = score | plus: CATEGORY_SCORE %}
38
+ {% endif %}
39
+ {% endfor %}
40
+
41
+ {% if score > 0 %}
42
+ {% capture score_item %}{{ score }}{{ SEPARATOR }}{{ i }}{% endcapture %}
43
+ {% assign score_list = score_list | push: score_item %}
44
+ {% endif %}
45
+
46
+ {% endfor %}
47
+
48
+
49
+ {% assign index_list = "" | split: "" %}
50
+
51
+ {% if score_list.size > 0 %}
52
+ {% assign score_list = score_list | sort | reverse %}
53
+ {% for entry in score_list limit: TOTAL_SIZE %}
54
+ {% assign index = entry | split: SEPARATOR | last %}
55
+ {% assign index_list = index_list | push: index %}
56
+ {% endfor %}
57
+ {% endif %}
58
+
59
+ <!-- Fill with the other newlest posts -->
60
+ {% assign less = TOTAL_SIZE | minus: index_list.size %}
61
+
62
+ {% if less > 0 %}
63
+ {% for i in (0..last_index) %}
64
+ {% assign post = site.posts[i] %}
65
+ {% if post.url != page.url %}
66
+ {% capture cur_index %}{{ i }}{% endcapture %}
67
+ {% unless index_list contains cur_index %}
68
+ {% assign index_list = index_list | push: cur_index %}
69
+ {% assign less = less | minus: 1 %}
70
+ {% if less <= 0 %}
71
+ {% break %}
72
+ {% endif %}
73
+ {% endunless %}
74
+ {% endif %}
75
+ {% endfor %}
76
+ {% endif %}
77
+
78
+ {% if index_list.size > 0 %}
79
+ <div id="related-posts" class="mb-2 mb-sm-4">
80
+ <h3 class="pt-2 mb-4 ml-1"
81
+ data-toc-skip>{{ site.data.locales[site.lang].post.relate_posts }}</h3>
82
+ <div class="card-deck mb-4">
83
+ {% for entry in index_list %}
84
+ {% assign index = entry | plus: 0 %}
85
+ {% assign post = site.posts[index] %}
86
+ <div class="card">
87
+ <a href="{{ post.url | relative_url }}">
88
+ <div class="card-body">
89
+ {% include datetime.html date=post.date class="small" %}
90
+ <h3 class="pt-0 mt-1 mb-3" data-toc-skip>{{ post.title }}</h3>
91
+ <div class="text-muted small">
92
+ <p>
93
+ {% include no-linenos.html content=post.content %}
94
+ {{ content | markdownify | strip_html | truncate: 200 | escape }}
95
+ </p>
96
+ </div>
97
+ </div>
98
+ </a>
99
+ </div>
100
+ {% endfor %}
101
+ </div> <!-- .card-deck -->
102
+ </div> <!-- #related-posts -->
103
+ {% endif %}
@@ -0,0 +1,46 @@
1
+ <!--
2
+ Jekyll Simple Search loader
3
+ See: <https://github.com/christian-fei/Simple-Jekyll-Search>
4
+ -->
5
+
6
+ {% capture result_elem %}
7
+ <div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
8
+ <a href="{url}">{title}</a>
9
+ <div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
10
+ {categories}
11
+ {tags}
12
+ </div>
13
+ <p>{snippet}</p>
14
+ </div>
15
+ {% endcapture %}
16
+
17
+ {% capture not_found %}<p class="mt-5">{{ site.data.locales[site.lang].search.no_results }}</p>{% endcapture %}
18
+
19
+ <script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
20
+
21
+ <script>
22
+ SimpleJekyllSearch({
23
+ searchInput: document.getElementById('search-input'),
24
+ resultsContainer: document.getElementById('search-results'),
25
+ json: '{{ '/assets/js/data/search.json' | relative_url }}',
26
+ searchResultTemplate: '{{ result_elem | strip_newlines }}',
27
+ noResultsText: '{{ not_found }}',
28
+ templateMiddleware: function(prop, value, template) {
29
+ if (prop === 'categories') {
30
+ if (value === '') {
31
+ return `${value}`;
32
+ } else {
33
+ return `<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
34
+ }
35
+ }
36
+
37
+ if (prop === 'tags') {
38
+ if (value === '') {
39
+ return `${value}`;
40
+ } else {
41
+ return `<div><i class="fa fa-tag fa-fw"></i>${value}</div>`;
42
+ }
43
+ }
44
+ }
45
+ });
46
+ </script>
@@ -0,0 +1,11 @@
1
+ <!--
2
+ The Search results
3
+ -->
4
+ <div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
5
+ <div class="col-12 col-sm-11 post-content">
6
+ <div id="search-hints">
7
+ {% include trending-tags.html %}
8
+ </div>
9
+ <div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
10
+ </div>
11
+ </div>
@@ -0,0 +1,104 @@
1
+ <!--
2
+ The Side Bar
3
+ -->
4
+
5
+ <section id="sidebar" class="d-flex flex-column align-items-end">
6
+ <div class="profile-wrapper">
7
+ <div id="avatar">
8
+ <a href="{{ '/' | relative_url }}" class="mx-auto">
9
+ {% if site.avatar != empty and site.avatar %}
10
+ {% capture avatar_url %}
11
+ {% if site.avatar contains '://' %}
12
+ {{ site.avatar }}
13
+ {% elsif site.img_cdn != empty and site.img_cdn %}
14
+ {{ site.avatar | prepend: site.img_cdn }}
15
+ {% else %}
16
+ {{ site.avatar | relative_url }}
17
+ {% endif %}
18
+ {% endcapture %}
19
+ <img src="{{ avatar_url | strip }}" alt="avatar" onerror="this.style.display='none'">
20
+ {% endif %}
21
+ </a>
22
+ </div>
23
+
24
+ <div class="site-title">
25
+ <a href="{{ '/' | relative_url }}">{{ site.profile.display_name }}</a>
26
+ </div>
27
+ <div class="site-profile-title">{{ site.profile.title }}</div>
28
+ <div class="site-subtitle font-italic">{{ site.tagline }}</div>
29
+
30
+ </div><!-- .profile-wrapper -->
31
+
32
+ <ul class="w-100">
33
+
34
+ <!-- home -->
35
+ <li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
36
+ <a href="{{ '/' | relative_url }}" class="nav-link">
37
+ <i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
38
+ <span>{{ site.data.locales[site.lang].tabs.home | upcase }}</span>
39
+ </a>
40
+ </li>
41
+ <!-- the real tabs -->
42
+ {% for tab in site.tabs %}
43
+ <li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
44
+ <a href="{{ tab.url | relative_url }}" class="nav-link">
45
+ <i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
46
+ {% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
47
+
48
+ <span>{{ site.data.locales[site.lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
49
+ </a>
50
+ </li> <!-- .nav-item -->
51
+ {% endfor %}
52
+
53
+ </ul> <!-- ul.nav.flex-column -->
54
+
55
+ <div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
56
+
57
+ {% unless site.theme_mode %}
58
+ <button class="mode-toggle btn" aria-label="Switch Mode">
59
+ <i class="fas fa-adjust"></i>
60
+ </button>
61
+
62
+ {% if site.data.contact.size > 0 %}
63
+ <span class="icon-border"></span>
64
+ {% endif %}
65
+ {% endunless %}
66
+
67
+ {% for entry in site.data.contact %}
68
+ {% capture url %}
69
+ {%- if entry.type == 'github' -%}
70
+ https://github.com/{{ site.github.username }}
71
+ {%- elsif entry.type == 'twitter' -%}
72
+ https://twitter.com/{{ site.twitter.username }}
73
+ {%- elsif entry.type == 'email' -%}
74
+ {% assign email = site.social.email | split: '@' %}
75
+ javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
76
+ {%- elsif entry.type == 'rss' -%}
77
+ {{ "/feed.xml" | relative_url }}
78
+ {%- else -%}
79
+ {{ entry.url }}
80
+ {%- endif -%}
81
+ {% endcapture %}
82
+
83
+ {% if url %}
84
+ <a href="{{ url }}" aria-label="{{ entry.type }}"
85
+ {% assign link_types = nil %}
86
+ {% unless entry.noblank %}
87
+ {% assign link_types = link_types | append: " noopener" %}
88
+ target="_blank"
89
+ {% endunless %}
90
+
91
+ {% if entry.type == 'mastodon' %}
92
+ {% assign link_types = link_types | append: " me" %}
93
+ {% endif %}
94
+
95
+ {% if link_types %}rel="{{ link_types | lstrip }}"{% endif %}>
96
+ <i class="{{ entry.icon }}"></i>
97
+ </a>
98
+ {% endif %}
99
+
100
+ {% endfor %}
101
+
102
+ </div> <!-- .sidebar-bottom -->
103
+
104
+ </section><!-- #sidebar -->
@@ -0,0 +1,16 @@
1
+ {% assign enable_toc = false %}
2
+ {% if site.toc and page.toc %}
3
+ {% if page.content contains '<h2' or page.content contains '<h3' %}
4
+ {% assign enable_toc = true %}
5
+ {% endif %}
6
+ {% endif %}
7
+
8
+ {% if enable_toc %}
9
+ <!-- BS-toc.js will be loaded at medium priority -->
10
+ <script src="{{ site.data.assets[origin].bootstrap-toc.js | relative_url }}"></script>
11
+
12
+ <div id="toc-wrapper" class="pl-0 pr-4 mb-5">
13
+ <div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[site.lang].panel.toc -}}</div>
14
+ <nav id="toc" data-toggle="toc"></nav>
15
+ </div>
16
+ {% endif %}
@@ -0,0 +1,70 @@
1
+ <!--
2
+ The Top Bar
3
+ -->
4
+
5
+ <section id="topbar-wrapper">
6
+ <div id="topbar" class="container d-flex align-items-center justify-content-between h-100 pl-3 pr-3 pl-md-4 pr-md-4">
7
+ <span id="breadcrumb">
8
+
9
+ {% assign paths = page.url | split: '/' %}
10
+
11
+ {% if paths.size == 0 or page.layout == 'home' %}
12
+ <!-- index page -->
13
+ <span>{{ site.title }}</span>
14
+
15
+ {% else %}
16
+
17
+ {% for item in paths %}
18
+
19
+ {% if forloop.first %}
20
+ <span>
21
+ <a href="{{ '/' | relative_url }}">
22
+ {{ site.title }}
23
+ </a>
24
+ </span>
25
+
26
+ {% elsif forloop.last %}
27
+
28
+ {% if page.collection == 'tabs' %}
29
+ <span>{{ site.data.locales[site.lang].tabs[item] | default: page.title }}</span>
30
+ {% else %}
31
+ <span>{{ page.title }}</span>
32
+ {% endif %}
33
+
34
+ {% elsif page.layout == 'category' or page.layout == 'tag' %}
35
+ <span>
36
+ <a href="{{ item | relative_url }}">
37
+ {{ site.data.locales[site.lang].tabs[item] | default: page.title }}
38
+ </a>
39
+ </span>
40
+ {% endif %}
41
+
42
+ {% endfor %}
43
+
44
+ {% endif %}
45
+
46
+ </span><!-- endof #breadcrumb -->
47
+
48
+ <i id="sidebar-trigger" class="fas fa-bars fa-fw"></i>
49
+
50
+ <div id="topbar-title">
51
+ {% if page.layout == 'home' %}
52
+ {{- site.data.locales[site.lang].title | default: site.title -}}
53
+ {% elsif page.collection == 'tabs' or page.layout == 'page' %}
54
+ {%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
55
+ {{- site.data.locales[site.lang].tabs[tab_key] | default: page.title -}}
56
+ {% else %}
57
+ {{- site.data.locales[site.lang].layout[page.layout] | default: page.layout | capitalize -}}
58
+ {% endif %}
59
+ </div>
60
+
61
+ <i id="search-trigger" class="fas fa-search fa-fw"></i>
62
+ <span id="search-wrapper" class="align-items-center">
63
+ <i class="fas fa-search fa-fw"></i>
64
+ <input class="form-control" id="search-input" type="search"
65
+ aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[site.lang].search.hint | capitalize }}...">
66
+ </span>
67
+ <span id="search-cancel" >{{ site.data.locales[site.lang].search.cancel }}</span>
68
+ </div>
69
+
70
+ </section>