jekyll-theme-abd3lraouf 5.2.3
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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +105 -0
- data/_config.yml +206 -0
- data/_data/assets/cross_origin.yml +62 -0
- data/_data/assets/self_host.yml +51 -0
- data/_data/authors.yml +17 -0
- data/_data/contact.yml +30 -0
- data/_data/locales/bg-BG.yml +83 -0
- data/_data/locales/en.yml +83 -0
- data/_data/locales/es-ES.yml +79 -0
- data/_data/locales/fr-FR.yml +79 -0
- data/_data/locales/hu-HU.yml +81 -0
- data/_data/locales/id-ID.yml +79 -0
- data/_data/locales/ko-KR.yml +79 -0
- data/_data/locales/my-MM.yml +79 -0
- data/_data/locales/pt-BR.yml +79 -0
- data/_data/locales/ru-RU.yml +79 -0
- data/_data/locales/tr-TR.yml +79 -0
- data/_data/locales/uk-UA.yml +79 -0
- data/_data/locales/vi-VN.yml +77 -0
- data/_data/locales/zh-CN.yml +78 -0
- data/_data/share.yml +27 -0
- data/_includes/assets-origin.html +12 -0
- data/_includes/comments/disqus.html +54 -0
- data/_includes/comments/giscus.html +56 -0
- data/_includes/comments/utterances.html +51 -0
- data/_includes/comments.html +5 -0
- data/_includes/datetime.html +21 -0
- data/_includes/favicons.html +17 -0
- data/_includes/footer.html +36 -0
- data/_includes/google-analytics.html +14 -0
- data/_includes/head.html +116 -0
- data/_includes/js-selector.html +104 -0
- data/_includes/jsdelivr-combine.html +32 -0
- data/_includes/lang.html +8 -0
- data/_includes/language-alias.html +70 -0
- data/_includes/mermaid.html +57 -0
- data/_includes/mode-toggle.html +129 -0
- data/_includes/no-linenos.html +10 -0
- data/_includes/post-nav.html +30 -0
- data/_includes/post-paginator.html +88 -0
- data/_includes/post-sharing.html +27 -0
- data/_includes/read-time.html +30 -0
- data/_includes/refactor-content.html +282 -0
- data/_includes/related-posts.html +103 -0
- data/_includes/search-loader.html +46 -0
- data/_includes/search-results.html +11 -0
- data/_includes/sidebar.html +93 -0
- data/_includes/toc.html +16 -0
- data/_includes/topbar.html +70 -0
- data/_includes/trending-tags.html +50 -0
- data/_includes/update-list.html +40 -0
- data/_layouts/archives.html +48 -0
- data/_layouts/categories.html +120 -0
- data/_layouts/category.html +24 -0
- data/_layouts/compress.html +10 -0
- data/_layouts/default.html +74 -0
- data/_layouts/home.html +103 -0
- data/_layouts/page.html +64 -0
- data/_layouts/post.html +159 -0
- data/_layouts/tag.html +23 -0
- data/_layouts/tags.html +23 -0
- data/_plugins/posts-lastmod-hook.rb +14 -0
- data/_sass/addon/commons.scss +1680 -0
- data/_sass/addon/module.scss +151 -0
- data/_sass/addon/syntax.scss +289 -0
- data/_sass/addon/variables.scss +34 -0
- data/_sass/colors/dark-syntax.scss +88 -0
- data/_sass/colors/dark-typography.scss +157 -0
- data/_sass/colors/light-syntax.scss +84 -0
- data/_sass/colors/light-typography.scss +94 -0
- data/_sass/jekyll-theme-abd3lraouf.scss +24 -0
- data/_sass/layout/archives.scss +147 -0
- data/_sass/layout/categories.scss +67 -0
- data/_sass/layout/category-tag.scss +73 -0
- data/_sass/layout/home.scss +184 -0
- data/_sass/layout/post.scss +369 -0
- data/_sass/layout/tags.scss +19 -0
- data/_sass/variables-hook.scss +3 -0
- data/_tabs/about.md +8 -0
- data/_tabs/archives.md +7 -0
- data/_tabs/categories.md +6 -0
- data/_tabs/tags.md +6 -0
- data/assets/404.html +16 -0
- data/assets/css/style.scss +12 -0
- data/assets/feed.xml +61 -0
- data/assets/img/favicons/android-chrome-192x192.png +0 -0
- data/assets/img/favicons/android-chrome-512x512.png +0 -0
- data/assets/img/favicons/apple-touch-icon.png +0 -0
- data/assets/img/favicons/browserconfig.xml +13 -0
- data/assets/img/favicons/favicon-16x16.png +0 -0
- data/assets/img/favicons/favicon-32x32.png +0 -0
- data/assets/img/favicons/favicon.ico +0 -0
- data/assets/img/favicons/mstile-150x150.png +0 -0
- data/assets/img/favicons/site.webmanifest +26 -0
- data/assets/js/data/search.json +18 -0
- data/assets/js/data/swcache.js +55 -0
- data/assets/js/dist/categories.min.js +6 -0
- data/assets/js/dist/commons.min.js +6 -0
- data/assets/js/dist/home.min.js +6 -0
- data/assets/js/dist/misc.min.js +6 -0
- data/assets/js/dist/page.min.js +6 -0
- data/assets/js/dist/post.min.js +6 -0
- data/assets/js/dist/pvreport.min.js +6 -0
- data/assets/js/pwa/app.js +47 -0
- data/assets/js/pwa/sw.js +89 -0
- data/assets/js/pwa/unregister.js +12 -0
- data/assets/robots.txt +10 -0
- data/index.html +4 -0
- metadata +243 -0
@@ -0,0 +1,282 @@
|
|
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
|
+
<!-- Add attribute 'hide-bullet' to the checkbox list -->
|
35
|
+
|
36
|
+
{% if _content contains '<li class="task-list-item"><' %}
|
37
|
+
{% assign _content = _content
|
38
|
+
| replace: '"task-list-item"><', '"task-list-item" hide-bullet><'
|
39
|
+
%}
|
40
|
+
{% endif %}
|
41
|
+
|
42
|
+
<!-- images -->
|
43
|
+
|
44
|
+
{% assign IMG_TAG = '<img ' %}
|
45
|
+
|
46
|
+
{% if _content contains IMG_TAG %}
|
47
|
+
{% assign _img_content = nil %}
|
48
|
+
{% assign _img_snippets = _content | split: IMG_TAG %}
|
49
|
+
|
50
|
+
{% for _img_snippet in _img_snippets %}
|
51
|
+
{% if forloop.first %}
|
52
|
+
{% assign _img_content = _img_snippet %}
|
53
|
+
{% continue %}
|
54
|
+
{% endif %}
|
55
|
+
|
56
|
+
{% assign _width = nil %}
|
57
|
+
{% assign _height = nil %}
|
58
|
+
{% assign _src = nil %}
|
59
|
+
|
60
|
+
{% assign _left = _img_snippet | split: '>' | first %}
|
61
|
+
{% assign _right = _img_snippet | remove: _left %}
|
62
|
+
|
63
|
+
{% assign _left = _left | remove: ' /' %}
|
64
|
+
{% assign _left = _left | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
|
65
|
+
{% assign _attrs = _left | split: ' ' %}
|
66
|
+
|
67
|
+
{% for _attr in _attrs %}
|
68
|
+
{% assign _pair = _attr | split: '=' %}
|
69
|
+
{% if _pair.size < 2 %}
|
70
|
+
{% continue %}
|
71
|
+
{% endif %}
|
72
|
+
|
73
|
+
{% capture _key %}{{ _pair | first }}{% endcapture %}
|
74
|
+
{% capture _value %}{{ _pair | last | replace: '"', '' }}{% endcapture %}
|
75
|
+
|
76
|
+
{% case _key %}
|
77
|
+
{% when 'width' %}
|
78
|
+
{% assign _width = _value %}
|
79
|
+
{% when 'height' %}
|
80
|
+
{% assign _height = _value %}
|
81
|
+
{% when 'src' %}
|
82
|
+
{% assign _src = _value %}
|
83
|
+
{% endcase %}
|
84
|
+
|
85
|
+
{% if _width and _height and _src %}
|
86
|
+
{% break %}
|
87
|
+
{% endif %}
|
88
|
+
{% endfor %}
|
89
|
+
|
90
|
+
{% if _src %}
|
91
|
+
{% unless _src contains '://' %}
|
92
|
+
|
93
|
+
<!-- Add CDN URL -->
|
94
|
+
{% if site.img_cdn %}
|
95
|
+
{% if site.img_cdn contains '//' %}
|
96
|
+
{% assign _src_prefix = site.img_cdn %}
|
97
|
+
{% else %}
|
98
|
+
{% assign _src_prefix = site.img_cdn | relative_url %}
|
99
|
+
{% endif %}
|
100
|
+
{% else %}
|
101
|
+
{% assign _src_prefix = site.baseurl %}
|
102
|
+
{% endif %}
|
103
|
+
|
104
|
+
<!-- Add image path -->
|
105
|
+
{% if page.img_path %}
|
106
|
+
{% assign _path = page.img_path %}
|
107
|
+
{% assign last_char = _path | slice: -1 %}
|
108
|
+
|
109
|
+
{% unless last_char == '/' %}
|
110
|
+
{% assign _path = _path | append: '/' %}
|
111
|
+
{% endunless %}
|
112
|
+
|
113
|
+
{% assign _src_prefix = _src_prefix | append: _path %}
|
114
|
+
{% endif %}
|
115
|
+
|
116
|
+
{% assign _final_src = _src_prefix | append: _src %}
|
117
|
+
{% assign _left = _left | replace: _src, _final_src %}
|
118
|
+
|
119
|
+
{% endunless %}
|
120
|
+
|
121
|
+
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
122
|
+
|
123
|
+
{% assign _left = _left | replace: 'src=', 'data-src=' %}
|
124
|
+
|
125
|
+
{% endif %}
|
126
|
+
|
127
|
+
<!-- Add SVG placehoder to prevent layout reflow -->
|
128
|
+
|
129
|
+
{% if _width and _height %}
|
130
|
+
{%- capture _svg -%}
|
131
|
+
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E"
|
132
|
+
{%- endcapture -%}
|
133
|
+
|
134
|
+
{% assign _left = _svg | append: ' ' | append: _left %}
|
135
|
+
{% endif %}
|
136
|
+
|
137
|
+
<!-- Bypass the HTML-proofer test -->
|
138
|
+
{% assign _left = _left | append: ' data-proofer-ignore' %}
|
139
|
+
|
140
|
+
{% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %}
|
141
|
+
|
142
|
+
{% endfor %}
|
143
|
+
|
144
|
+
{% assign _content = _img_content %}
|
145
|
+
|
146
|
+
{% endif %}
|
147
|
+
|
148
|
+
<!-- Add header for code snippets -->
|
149
|
+
|
150
|
+
{% if _content contains '<div class="highlight"><code>' %}
|
151
|
+
{% assign _code_spippets = _content | split: '<div class="highlight"><code>' %}
|
152
|
+
{% assign _new_content = '' %}
|
153
|
+
|
154
|
+
{% for _snippet in _code_spippets %}
|
155
|
+
|
156
|
+
{% if forloop.last %}
|
157
|
+
{% assign _new_content = _new_content | append: _snippet %}
|
158
|
+
|
159
|
+
{% else %}
|
160
|
+
|
161
|
+
{% assign _left = _snippet | split: '><' | last%}
|
162
|
+
|
163
|
+
{% if _left contains 'file="' %}
|
164
|
+
{% assign _label_text = _left | split: 'file="' | last | split: '"' | first %}
|
165
|
+
{% assign _label_icon = 'far fa-file-code' %}
|
166
|
+
{% else %}
|
167
|
+
{% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
|
168
|
+
{% capture _label_text %}{% include language-alias.html language=_lang %}{% endcapture %}
|
169
|
+
{% assign _label_icon = 'fas fa-code small' %}
|
170
|
+
{% endif %}
|
171
|
+
|
172
|
+
{% capture _label %}
|
173
|
+
<span data-label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
|
174
|
+
{% endcapture %}
|
175
|
+
|
176
|
+
{% assign _new_content = _new_content | append: _snippet
|
177
|
+
| append: '<div class="code-header">'
|
178
|
+
| append: _label
|
179
|
+
| append: '<button aria-label="copy" data-title-succeed="'
|
180
|
+
| append: site.data.locales[lang].post.button.copy_code.succeed
|
181
|
+
| append: '"><i class="far fa-clipboard"></i></button></div>'
|
182
|
+
| append: '<div class="highlight"><code>'
|
183
|
+
%}
|
184
|
+
|
185
|
+
{% endif %}
|
186
|
+
|
187
|
+
{% endfor %}
|
188
|
+
|
189
|
+
{% assign _content = _new_content %}
|
190
|
+
|
191
|
+
{% endif %}
|
192
|
+
|
193
|
+
<!-- Create heading anchors -->
|
194
|
+
|
195
|
+
{% assign heading_levels = '2,3,4,5' | split: ',' %}
|
196
|
+
{% assign _heading_content = _content %}
|
197
|
+
|
198
|
+
{% for level in heading_levels %}
|
199
|
+
{% capture mark_start %}<h{{ level }} id="{% endcapture %}
|
200
|
+
{% capture mark_end %}</h{{ level }}>{% endcapture %}
|
201
|
+
|
202
|
+
{% if _heading_content contains mark_start %}
|
203
|
+
{% assign _new_content = nil %}
|
204
|
+
{% assign heading_snippets = _heading_content | split: mark_start %}
|
205
|
+
|
206
|
+
{% for snippet in heading_snippets %}
|
207
|
+
{% if forloop.first %}
|
208
|
+
{% assign _new_content = snippet %}
|
209
|
+
{% continue %}
|
210
|
+
{% endif %}
|
211
|
+
|
212
|
+
{% assign id = snippet | split: '"' | first %}
|
213
|
+
{% capture anchor %}<a href="#{{ id }}" class="anchor text-muted"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
214
|
+
|
215
|
+
{% assign left = snippet | split: mark_end | first %}
|
216
|
+
{% assign right = snippet | slice: left.size, snippet.size %}
|
217
|
+
{% assign left = left | replace: '">', '"><span class="mr-2">' | append: '</span>' %}
|
218
|
+
|
219
|
+
{% assign _new_content = _new_content | append: mark_start
|
220
|
+
| append: left | append: anchor | append: right
|
221
|
+
%}
|
222
|
+
|
223
|
+
{% endfor %}
|
224
|
+
|
225
|
+
{% assign _heading_content = _new_content %}
|
226
|
+
|
227
|
+
{% endif %}
|
228
|
+
{% endfor %}
|
229
|
+
|
230
|
+
{% assign _content = _heading_content %}
|
231
|
+
|
232
|
+
<!-- Wrap prompt element of blockquote with the <div> tag -->
|
233
|
+
|
234
|
+
{% assign blockquote_start = '<blockquote class=' %}
|
235
|
+
{% assign blockquote_end = '</blockquote>' %}
|
236
|
+
{% assign cls_prefix = 'prompt-' %}
|
237
|
+
|
238
|
+
{% if _content contains blockquote_start %}
|
239
|
+
|
240
|
+
{% assign _prompt_content = nil %}
|
241
|
+
{% assign _prompt_snippets = _content | split: blockquote_start %}
|
242
|
+
|
243
|
+
{% for _snippet in _prompt_snippets %}
|
244
|
+
|
245
|
+
{% if forloop.first %}
|
246
|
+
{% assign _prompt_content = _snippet %}
|
247
|
+
{% continue %}
|
248
|
+
{% endif %}
|
249
|
+
|
250
|
+
{% assign left = _snippet | split: blockquote_end | first %}
|
251
|
+
{% assign right = _snippet | slice: left.size, _snippet.size %}
|
252
|
+
|
253
|
+
{% assign cls_str = left | split: '>' | first %}
|
254
|
+
{% assign cls_array = cls_str | remove: '"' | split: ' ' %}
|
255
|
+
{% assign is_prompt = false %}
|
256
|
+
|
257
|
+
{% for cls in cls_array %}
|
258
|
+
{% if cls contains cls_prefix %}
|
259
|
+
{% assign is_prompt = true %}
|
260
|
+
{% break %}
|
261
|
+
{% endif %}
|
262
|
+
{% endfor %}
|
263
|
+
|
264
|
+
{% unless is_prompt %}
|
265
|
+
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: _snippet %}
|
266
|
+
{% continue %}
|
267
|
+
{% endunless %}
|
268
|
+
|
269
|
+
{% assign left = left | slice: cls_str.size, left.size %}
|
270
|
+
{% assign left = cls_str | append: '><div' | append: left | append: '</div>' %}
|
271
|
+
|
272
|
+
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: left | append: right %}
|
273
|
+
|
274
|
+
{% endfor %}
|
275
|
+
|
276
|
+
{% assign _content = _prompt_content %}
|
277
|
+
|
278
|
+
{% endif %}
|
279
|
+
|
280
|
+
<!-- return -->
|
281
|
+
|
282
|
+
{{ _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="mt-5 mb-2 mb-sm-4">
|
80
|
+
<h3 class="pt-2 mt-1 mb-4 ml-1"
|
81
|
+
data-toc-skip>{{ site.data.locales[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[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,93 @@
|
|
1
|
+
<!--
|
2
|
+
The Side Bar
|
3
|
+
-->
|
4
|
+
|
5
|
+
<div id="sidebar" class="d-flex flex-column align-items-end">
|
6
|
+
<div class="profile-wrapper text-center">
|
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 mt-3">
|
25
|
+
<a href="{{ '/' | relative_url }}">{{ site.title }}</a>
|
26
|
+
</div>
|
27
|
+
<div class="site-subtitle font-italic">{{ site.tagline }}</div>
|
28
|
+
|
29
|
+
</div><!-- .profile-wrapper -->
|
30
|
+
|
31
|
+
<ul class="w-100">
|
32
|
+
|
33
|
+
<!-- home -->
|
34
|
+
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
35
|
+
<a href="{{ '/' | relative_url }}" class="nav-link">
|
36
|
+
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
37
|
+
<span>{{ site.data.locales[lang].tabs.home | upcase }}</span>
|
38
|
+
</a>
|
39
|
+
</li>
|
40
|
+
<!-- the real tabs -->
|
41
|
+
{% for tab in site.tabs %}
|
42
|
+
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
|
43
|
+
<a href="{{ tab.url | relative_url }}" class="nav-link">
|
44
|
+
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
45
|
+
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
|
46
|
+
|
47
|
+
<span>{{ site.data.locales[lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
|
48
|
+
</a>
|
49
|
+
</li> <!-- .nav-item -->
|
50
|
+
{% endfor %}
|
51
|
+
|
52
|
+
</ul> <!-- ul.nav.flex-column -->
|
53
|
+
|
54
|
+
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
|
55
|
+
|
56
|
+
{% unless site.theme_mode %}
|
57
|
+
<button class="mode-toggle btn" aria-label="Switch Mode">
|
58
|
+
<i class="fas fa-adjust"></i>
|
59
|
+
</button>
|
60
|
+
|
61
|
+
{% if site.data.contact.size > 0 %}
|
62
|
+
<span class="icon-border"></span>
|
63
|
+
{% endif %}
|
64
|
+
{% endunless %}
|
65
|
+
|
66
|
+
{% for entry in site.data.contact %}
|
67
|
+
{% capture url %}
|
68
|
+
{%- if entry.type == 'github' -%}
|
69
|
+
https://github.com/{{ site.github.username }}
|
70
|
+
{%- elsif entry.type == 'twitter' -%}
|
71
|
+
https://twitter.com/{{ site.twitter.username }}
|
72
|
+
{%- elsif entry.type == 'email' -%}
|
73
|
+
{% assign email = site.social.email | split: '@' %}
|
74
|
+
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
|
75
|
+
{%- elsif entry.type == 'rss' -%}
|
76
|
+
{{ "/feed.xml" | relative_url }}
|
77
|
+
{%- else -%}
|
78
|
+
{{ entry.url }}
|
79
|
+
{%- endif -%}
|
80
|
+
{% endcapture %}
|
81
|
+
|
82
|
+
{% if url %}
|
83
|
+
<a href="{{ url }}" aria-label="{{ entry.type }}"
|
84
|
+
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
|
85
|
+
<i class="{{ entry.icon }}"></i>
|
86
|
+
</a>
|
87
|
+
{% endif %}
|
88
|
+
|
89
|
+
{% endfor %}
|
90
|
+
|
91
|
+
</div> <!-- .sidebar-bottom -->
|
92
|
+
|
93
|
+
</div><!-- #sidebar -->
|
data/_includes/toc.html
ADDED
@@ -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[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
|
+
<div 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.data.locales[lang].tabs.home | capitalize }}</span>
|
14
|
+
|
15
|
+
{% else %}
|
16
|
+
|
17
|
+
{% for item in paths %}
|
18
|
+
|
19
|
+
{% if forloop.first %}
|
20
|
+
<span>
|
21
|
+
<a href="{{ '/' | relative_url }}">
|
22
|
+
{{ site.data.locales[lang].tabs.home | capitalize }}
|
23
|
+
</a>
|
24
|
+
</span>
|
25
|
+
|
26
|
+
{% elsif forloop.last %}
|
27
|
+
|
28
|
+
{% if page.collection == 'tabs' %}
|
29
|
+
<span>{{ site.data.locales[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[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[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[lang].tabs[tab_key] | default: page.title -}}
|
56
|
+
{% else %}
|
57
|
+
{{- site.data.locales[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[lang].search.hint | capitalize }}...">
|
66
|
+
</span>
|
67
|
+
<span id="search-cancel" >{{ site.data.locales[lang].search.cancel }}</span>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
</div>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
{% comment %}
|
2
|
+
The trending tags list
|
3
|
+
{% endcomment %}
|
4
|
+
|
5
|
+
{% assign MAX = 10 %}
|
6
|
+
|
7
|
+
{% assign size_list = "" | split: "" %}
|
8
|
+
{% assign tag_list = "" | split: "" %}
|
9
|
+
|
10
|
+
{% for tag in site.tags %}
|
11
|
+
{% assign size = tag | last | size %}
|
12
|
+
{% assign size_list = size_list | push: size %}
|
13
|
+
|
14
|
+
{% assign tag_str = tag | first | append: "::" | append: size %}
|
15
|
+
{% assign tag_list = tag_list | push: tag_str %}
|
16
|
+
{% endfor %}
|
17
|
+
|
18
|
+
{% assign size_list = size_list | sort | reverse %}
|
19
|
+
|
20
|
+
{% assign tag_list = tag_list | sort_natural %}
|
21
|
+
|
22
|
+
{% assign trending_tags = "" | split: "" %}
|
23
|
+
|
24
|
+
{% for size in size_list limit: MAX %}
|
25
|
+
{% for tag_str in tag_list %}
|
26
|
+
{% assign tag = tag_str | split: "::" %}
|
27
|
+
{% assign tag_name = tag | first %}
|
28
|
+
{% assign tag_size = tag | last | plus: 0 %}
|
29
|
+
{% if tag_size == size %}
|
30
|
+
{% unless trending_tags contains tag_name %}
|
31
|
+
{% assign trending_tags = trending_tags | push: tag_name %}
|
32
|
+
{% break %}
|
33
|
+
{% endunless %}
|
34
|
+
{% endif %}
|
35
|
+
{% endfor %}
|
36
|
+
{% endfor %}
|
37
|
+
|
38
|
+
{% if trending_tags.size > 0 %}
|
39
|
+
<div id="access-tags">
|
40
|
+
<div class="panel-heading">{{- site.data.locales[lang].panel.trending_tags -}}</div>
|
41
|
+
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
42
|
+
|
43
|
+
{% for tag_name in trending_tags %}
|
44
|
+
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
45
|
+
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
46
|
+
{% endfor %}
|
47
|
+
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
{% endif %}
|