jekyll-theme-chirpy 4.3.1 → 5.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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -32
  3. data/_config.yml +12 -8
  4. data/_data/locales/en.yml +2 -1
  5. data/_data/locales/id-ID.yml +2 -1
  6. data/_data/locales/ko-KR.yml +91 -0
  7. data/_data/locales/zh-CN.yml +2 -1
  8. data/_includes/{disqus.html → comments/disqus.html} +4 -4
  9. data/_includes/comments/utterances.html +51 -0
  10. data/_includes/comments.html +5 -0
  11. data/_includes/footer.html +1 -1
  12. data/_includes/js-selector.html +1 -1
  13. data/_includes/language-alias.html +1 -3
  14. data/_includes/mermaid.html +28 -0
  15. data/_includes/mode-toggle.html +48 -65
  16. data/_includes/read-time.html +3 -3
  17. data/_includes/refactor-content.html +109 -35
  18. data/_includes/related-posts.html +1 -1
  19. data/_includes/search-loader.html +1 -1
  20. data/_includes/search-results.html +0 -8
  21. data/_includes/sidebar.html +10 -11
  22. data/_includes/timeago.html +11 -12
  23. data/_includes/toc.html +16 -0
  24. data/_includes/topbar.html +1 -1
  25. data/_includes/trending-tags.html +14 -0
  26. data/_includes/update-list.html +16 -0
  27. data/_layouts/default.html +6 -2
  28. data/_layouts/home.html +12 -9
  29. data/_layouts/page.html +45 -22
  30. data/_layouts/post.html +128 -127
  31. data/_sass/addon/commons.scss +198 -187
  32. data/_sass/addon/module.scss +48 -28
  33. data/_sass/addon/syntax.scss +56 -43
  34. data/_sass/addon/variables.scss +1 -1
  35. data/_sass/colors/dark-syntax.scss +3 -4
  36. data/_sass/colors/dark-typography.scss +23 -15
  37. data/_sass/colors/light-syntax.scss +3 -3
  38. data/_sass/colors/light-typography.scss +4 -5
  39. data/_sass/jekyll-theme-chirpy.scss +1 -1
  40. data/_sass/layout/archives.scss +5 -1
  41. data/_sass/layout/category-tag.scss +3 -2
  42. data/_sass/layout/home.scss +15 -4
  43. data/_sass/layout/post.scss +70 -46
  44. data/_sass/layout/tags.scss +1 -0
  45. data/assets/js/data/search.json +1 -1
  46. data/assets/js/dist/categories.min.js +2 -2
  47. data/assets/js/dist/commons.min.js +2 -2
  48. data/assets/js/dist/home.min.js +2 -2
  49. data/assets/js/dist/page.min.js +2 -2
  50. data/assets/js/dist/post.min.js +2 -2
  51. data/assets/js/dist/pvreport.min.js +2 -2
  52. metadata +12 -9
  53. data/_includes/panel.html +0 -59
@@ -2,14 +2,12 @@
2
2
  Switch the mode between dark and light.
3
3
  -->
4
4
 
5
- <i class="mode-toggle fas fa-adjust"></i>
6
-
7
5
  <script type="text/javascript">
8
-
9
6
  class ModeToggle {
10
7
  static get MODE_KEY() { return "mode"; }
11
8
  static get DARK_MODE() { return "dark"; }
12
9
  static get LIGHT_MODE() { return "light"; }
10
+ static get ID() { return "mode-toggle"; }
13
11
 
14
12
  constructor() {
15
13
  if (this.hasMode) {
@@ -24,10 +22,10 @@
24
22
  }
25
23
  }
26
24
 
27
- var self = this;
25
+ let self = this;
28
26
 
29
27
  /* always follow the system prefers */
30
- this.sysDarkPrefers.addListener(function() {
28
+ this.sysDarkPrefers.addEventListener("change", () => {
31
29
  if (self.hasMode) {
32
30
  if (self.isDarkMode) {
33
31
  if (!self.isSysDarkPrefer) {
@@ -43,34 +41,19 @@
43
41
  self.clearMode();
44
42
  }
45
43
 
46
- self.updateMermaid();
44
+ self.notify();
45
+
47
46
  });
48
47
 
49
48
  } /* constructor() */
50
49
 
51
-
52
- setDark() {
53
- $('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
54
- sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
55
- }
56
-
57
- setLight() {
58
- $('html').attr(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
59
- sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
60
- }
61
-
62
- clearMode() {
63
- $('html').removeAttr(ModeToggle.MODE_KEY);
64
- sessionStorage.removeItem(ModeToggle.MODE_KEY);
65
- }
66
-
67
50
  get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
68
51
 
69
52
  get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
70
53
 
71
- get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
54
+ get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
72
55
 
73
- get isLightMode() { return this.mode == ModeToggle.LIGHT_MODE; }
56
+ get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
74
57
 
75
58
  get hasMode() { return this.mode != null; }
76
59
 
@@ -79,67 +62,67 @@
79
62
  /* get the current mode on screen */
80
63
  get modeStatus() {
81
64
  if (this.isDarkMode
82
- || (!this.hasMode && this.isSysDarkPrefer) ) {
65
+ || (!this.hasMode && this.isSysDarkPrefer)) {
83
66
  return ModeToggle.DARK_MODE;
84
67
  } else {
85
68
  return ModeToggle.LIGHT_MODE;
86
69
  }
87
70
  }
88
71
 
89
- updateMermaid() {
90
- if (typeof mermaid !== "undefined") {
91
- let expectedTheme = (this.modeStatus === ModeToggle.DARK_MODE? "dark" : "default");
92
- let config = { theme: expectedTheme };
72
+ setDark() {
73
+ $('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
74
+ sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
75
+ }
76
+
77
+ setLight() {
78
+ $('html').attr(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
79
+ sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
80
+ }
93
81
 
94
- /* re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
95
- $(".mermaid").each(function() {
96
- let svgCode = $(this).prev().children().html();
97
- $(this).removeAttr("data-processed");
98
- $(this).html(svgCode);
99
- });
82
+ clearMode() {
83
+ $('html').removeAttr(ModeToggle.MODE_KEY);
84
+ sessionStorage.removeItem(ModeToggle.MODE_KEY);
85
+ }
100
86
 
101
- mermaid.initialize(config);
102
- mermaid.init(undefined, ".mermaid");
103
- }
87
+ /* Notify another plugins that the theme mode has changed */
88
+ notify() {
89
+ window.postMessage({
90
+ direction: ModeToggle.ID,
91
+ message: this.modeStatus
92
+ }, "*");
104
93
  }
105
94
 
106
- flipMode() {
107
- if (this.hasMode) {
108
- if (this.isSysDarkPrefer) {
109
- if (this.isLightMode) {
110
- this.clearMode();
111
- } else {
112
- this.setLight();
113
- }
95
+ } /* ModeToggle */
114
96
 
97
+ const toggle = new ModeToggle();
98
+
99
+ function flipMode() {
100
+ if (toggle.hasMode) {
101
+ if (toggle.isSysDarkPrefer) {
102
+ if (toggle.isLightMode) {
103
+ toggle.clearMode();
115
104
  } else {
116
- if (this.isDarkMode) {
117
- this.clearMode();
118
- } else {
119
- this.setDark();
120
- }
105
+ toggle.setLight();
121
106
  }
122
107
 
123
108
  } else {
124
- if (this.isSysDarkPrefer) {
125
- this.setLight();
109
+ if (toggle.isDarkMode) {
110
+ toggle.clearMode();
126
111
  } else {
127
- this.setDark();
112
+ toggle.setDark();
128
113
  }
129
114
  }
130
115
 
131
- this.updateMermaid();
132
-
133
- } /* flipMode() */
134
-
135
- } /* ModeToggle */
136
-
137
- let toggle = new ModeToggle();
138
-
139
- $(".mode-toggle").click(function() {
116
+ } else {
117
+ if (toggle.isSysDarkPrefer) {
118
+ toggle.setLight();
119
+ } else {
120
+ toggle.setDark();
121
+ }
122
+ }
140
123
 
141
- toggle.flipMode();
124
+ toggle.notify();
142
125
 
143
- });
126
+ } /* flipMode() */
144
127
 
145
128
  </script>
@@ -22,9 +22,9 @@
22
22
  <!-- return element -->
23
23
  <span class="readtime" data-toggle="tooltip" data-placement="bottom"
24
24
  title="{{ words }} {{ site.data.locales[lang].post.words }}">
25
- {{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}
25
+ <em>{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}</em>
26
26
  {%- if include.prompt -%}
27
- {% assign _prompt_words = read_prompt | number_of_words: 'auto' %}
28
- {% unless _prompt_words > 1 %}{{" "}}{% endunless %}{{ read_prompt }}
27
+ {%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
28
+ {%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
29
29
  {%- endif -%}
30
30
  </span>
@@ -38,63 +38,100 @@
38
38
  %}
39
39
  {% endif %}
40
40
 
41
-
42
41
  <!-- images -->
43
42
 
44
- {% if _content contains '<img src="' %}
45
-
46
- <!-- add CDN prefix if it exists -->
47
-
48
- {% if site.img_cdn != '' %}
49
- {% assign img_path_replacement = '<img src="' | append: site.img_cdn | append: '/' %}
50
- {% else %}
51
- {% assign img_path_replacement = '<img src="' | append: site.baseurl | append: '/' %}
52
- {% endif %}
53
-
54
- {% assign _content = _content | replace: '<img src="/', img_path_replacement %}
55
-
56
- <!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
57
-
58
- {% assign _content = _content | replace: '<img src="', '<img data-proofer-ignore data-src="' %}
59
-
60
- <!-- add image placehoder to prevent layout reflow -->
43
+ {% assign IMG_TAG = '<img ' %}
61
44
 
45
+ {% if _content contains IMG_TAG %}
62
46
  {% assign _img_content = nil %}
47
+ {% assign _img_snippets = _content | split: IMG_TAG %}
63
48
 
64
- {% assign _images = _content | split: '<img ' %}
65
-
66
- {% for _img in _images %}
49
+ {% for _img_snippet in _img_snippets %}
67
50
  {% if forloop.first %}
68
- {% assign _img_content = _img %}
51
+ {% assign _img_content = _img_snippet %}
69
52
  {% continue %}
70
53
  {% endif %}
71
54
 
72
55
  {% assign _width = nil %}
73
56
  {% assign _height = nil %}
74
- {% assign _attrs = _img | split: '>' | first | split: ' ' %}
57
+ {% assign _src = nil %}
58
+
59
+ {% assign _left = _img_snippet | split: '/>' | first %}
60
+ {% assign _right = _img_snippet | replace: _left, '' %}
61
+
62
+ {% assign _left = _left | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
63
+ {% assign _attrs = _left | split: ' ' %}
75
64
 
76
65
  {% for _attr in _attrs %}
77
- {% capture _key %}{{ _attr | split: '=' | first }}{% endcapture %}
78
- {% capture _value %}{{ _attr | split: '=' | last | replace: '"', '' }}{% endcapture %}
66
+ {% assign _pair = _attr | split: '=' %}
67
+ {% if _pair.size < 2 %}
68
+ {% continue %}
69
+ {% endif %}
70
+
71
+ {% capture _key %}{{ _pair | first }}{% endcapture %}
72
+ {% capture _value %}{{ _pair | last | replace: '"', '' }}{% endcapture %}
79
73
 
80
74
  {% case _key %}
81
75
  {% when 'width' %}
82
76
  {% assign _width = _value %}
83
77
  {% when 'height' %}
84
78
  {% assign _height = _value %}
79
+ {% when 'src' %}
80
+ {% assign _src = _value %}
85
81
  {% endcase %}
86
82
 
87
- {% if _width and _height %}
88
- {% capture _svg %}data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{_width}} {{_height}}'%3E%3C/svg%3E{% endcapture %}
89
- {% assign _img_content = _img_content | append: '<img src="' | append: _svg | append: '" ' | append: _img %}
83
+ {% if _width and _height and _src %}
90
84
  {% break %}
91
85
  {% endif %}
92
-
93
86
  {% endfor %}
94
87
 
95
- {% unless _width and _height %}
96
- {% assign _img_content = _img_content | append: '<img ' | append: _img %}
97
- {% endunless %}
88
+ {% if _src %}
89
+ {% unless _src contains '://' %}
90
+
91
+ <!-- Add CDN URL -->
92
+ {% if site.img_cdn %}
93
+ {% assign _src_prefix = site.img_cdn %}
94
+ {% else %}
95
+ {% assign _src_prefix = site.baseurl %}
96
+ {% endif %}
97
+
98
+ <!-- Add image path -->
99
+ {% if page.img_path %}
100
+ {% assign _path = page.img_path %}
101
+ {% assign last_char = _path | slice: -1 %}
102
+
103
+ {% unless last_char == '/' %}
104
+ {% assign _path = _path | append: '/' %}
105
+ {% endunless %}
106
+
107
+ {% assign _src_prefix = _src_prefix | append: _path %}
108
+ {% endif %}
109
+
110
+ {% assign _final_src = _src_prefix | append: _src %}
111
+ {% assign _left = _left | replace: _src, _final_src %}
112
+
113
+ {% endunless %}
114
+
115
+ <!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
116
+
117
+ {% assign _left = _left | replace: 'src=', 'data-src=' %}
118
+
119
+ {% endif %}
120
+
121
+ <!-- Add SVG placehoder to prevent layout reflow -->
122
+
123
+ {% if _width and _height %}
124
+ {%- capture _svg -%}
125
+ src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E"
126
+ {%- endcapture -%}
127
+
128
+ {% assign _left = _svg | append: ' ' | append: _left %}
129
+ {% endif %}
130
+
131
+ <!-- Bypass the HTML-proofer test -->
132
+ {% assign _left = _left | append: ' data-proofer-ignore' %}
133
+
134
+ {% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %}
98
135
 
99
136
  {% endfor %}
100
137
 
@@ -118,16 +155,16 @@
118
155
  {% assign _left = _snippet | split: '><' | last%}
119
156
 
120
157
  {% if _left contains 'file="' %}
121
- {% assign _text = _left | split: 'file="' | last | split: '"' | first %}
158
+ {% assign _label_text = _left | split: 'file="' | last | split: '"' | first %}
122
159
  {% assign _label_icon = 'far fa-file-code' %}
123
160
  {% else %}
124
161
  {% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
125
- {% capture _text %}{% include language-alias.html language=_lang %}{% endcapture %}
162
+ {% capture _label_text %}{% include language-alias.html language=_lang %}{% endcapture %}
126
163
  {% assign _label_icon = 'fas fa-code small' %}
127
164
  {% endif %}
128
165
 
129
166
  {% capture _label %}
130
- <span text-data="{{ _text }}"><i class="fa-fw {{ _label_icon }}"></i></span>
167
+ <span label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
131
168
  {% endcapture %}
132
169
 
133
170
  {% assign _new_content = _new_content | append: _snippet
@@ -147,6 +184,43 @@
147
184
 
148
185
  {% endif %}
149
186
 
187
+ <!-- Create heading anchors -->
188
+
189
+ {% assign heading_levels = '2,3,4,5' | split: ',' %}
190
+ {% assign _heading_content = _content %}
191
+
192
+ {% for level in heading_levels %}
193
+ {% capture mark_start %}<h{{ level }} id="{% endcapture %}
194
+ {% capture mark_end %}</h{{ level }}>{% endcapture %}
195
+
196
+ {% if _heading_content contains mark_start %}
197
+ {% assign _new_content = nil %}
198
+ {% assign heading_snippets = _heading_content | split: mark_start %}
199
+
200
+ {% for snippet in heading_snippets %}
201
+ {% if forloop.first %}
202
+ {% assign _new_content = snippet %}
203
+ {% continue %}
204
+ {% endif %}
205
+
206
+ {% assign id = snippet | split: '"' | first %}
207
+ {% capture anchor %}<a href="#{{ id }}" class="anchor"><i class="fas fa-hashtag"></i></a>{% endcapture %}
208
+
209
+ {% assign left = snippet | split: mark_end | first %}
210
+ {% assign right = snippet | replace: left, '' %}
211
+
212
+ {% assign _new_content = _new_content | append: mark_start
213
+ | append: left | append: anchor | append: mark_end | append: right
214
+ %}
215
+
216
+ {% endfor %}
217
+
218
+ {% assign _heading_content = _new_content %}
219
+
220
+ {% endif %}
221
+ {% endfor %}
222
+
223
+ {% assign _content = _heading_content %}
150
224
 
151
225
  <!-- return -->
152
226
 
@@ -94,7 +94,7 @@
94
94
  <div class="text-muted small">
95
95
  <p>
96
96
  {% include no-linenos.html content=post.content %}
97
- {{ content | markdownify | strip_html | truncate: 200 }}
97
+ {{ content | markdownify | strip_html | truncate: 200 | escape }}
98
98
  </p>
99
99
  </div>
100
100
  </div>
@@ -5,7 +5,7 @@
5
5
 
6
6
  {% capture result_elem %}
7
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="{{ site.url }}{url}">{title}</a>
8
+ <a href="{url}">{title}</a>
9
9
  <div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
10
10
  {categories}
11
11
  {tags}
@@ -4,15 +4,7 @@
4
4
  <div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
5
5
  <div class="col-12 col-sm-11 post-content">
6
6
  <div id="search-hints">
7
- <h4 class="text-muted mb-4">{{ site.data.locales[lang].panel.trending_tags }}</h4>
8
-
9
7
  {% include trending-tags.html %}
10
-
11
- {% for tag in trending_tags %}
12
- {% capture url %}/tags/{{ tag | slugify | url_encode }}/{% endcapture %}
13
- <a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
14
- {% endfor %}
15
-
16
8
  </div>
17
9
  <div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
18
10
  </div>
@@ -53,6 +53,16 @@
53
53
 
54
54
  <div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
55
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
+
56
66
  {% for entry in site.data.contact %}
57
67
  {% capture url %}
58
68
  {%- if entry.type == 'github' -%}
@@ -71,7 +81,6 @@
71
81
 
72
82
  {% if url %}
73
83
  <a href="{{ url }}" aria-label="{{ entry.type }}"
74
- {% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
75
84
  {% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
76
85
  <i class="{{ entry.icon }}"></i>
77
86
  </a>
@@ -79,16 +88,6 @@
79
88
 
80
89
  {% endfor %}
81
90
 
82
- {% unless site.theme_mode %}
83
- {% if site.data.contact.size > 0 %}
84
- <span class="icon-border order-2"></span>
85
- {% endif %}
86
-
87
- <span id="mode-toggle-wrapper" class="order-1">
88
- {% include mode-toggle.html %}
89
- </span>
90
- {% endunless %}
91
-
92
91
  </div> <!-- .sidebar-bottom -->
93
92
 
94
93
  </div><!-- #sidebar -->
@@ -1,27 +1,26 @@
1
1
  <!--
2
2
  Date format snippet
3
- See: /assets/js/_utils/timeage.js
3
+ See: ${JS_ROOT}/utils/timeago.js
4
4
  -->
5
5
 
6
6
  {% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
7
7
  {% assign post_long_df = site.data.locales[lang].date_format.post.long %}
8
8
  {% assign post_short_df = site.data.locales[lang].date_format.post.short %}
9
9
 
10
- {% if include.preposition %}
11
- {{ include.preposition }}
12
- {% endif %}
13
- <span class="timeago {% if include.class %}{{ include.class }}{% endif %}"
14
- {% if include.tooltip %}
15
- data-toggle="tooltip"
16
- data-placement="bottom"
17
- title="{{ include.date | date: tooltip_df }}"
18
- {% endif %}>
10
+ <em class="timeago{% if include.class %} {{ include.class }}{% endif %}"
11
+ date="{{ include.date }}"
12
+ {% if include.tooltip %}
13
+ data-toggle="tooltip"
14
+ data-placement="bottom"
15
+ title="{{ include.date | date: tooltip_df }}"
16
+ {% endif %}>
17
+
19
18
  {%- assign this_year = site.time | date: "%Y" -%}
20
19
  {%- assign post_year = include.date | date: "%Y" -%}
20
+
21
21
  {%- if post_year == this_year -%}
22
22
  {{ include.date | date: post_short_df }}
23
23
  {%- else -%}
24
24
  {{ include.date | date: post_long_df }}
25
25
  {%- endif -%}
26
- <i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
27
- </span>
26
+ </em>
@@ -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="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></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 %}
@@ -50,7 +50,7 @@
50
50
  <div id="topbar-title">
51
51
  {% if page.layout == 'home' %}
52
52
  {{- site.data.locales[lang].title | default: site.title -}}
53
- {% elsif page.collection == 'tabs' %}
53
+ {% elsif page.collection == 'tabs' or page.dynamic_title %}
54
54
  {%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
55
55
  {{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
56
56
  {% else %}
@@ -34,3 +34,17 @@
34
34
  {% endif %}
35
35
  {% endfor %}
36
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 %}
@@ -22,3 +22,19 @@
22
22
  {% for entry in all_list limit:MAX_SIZE %}
23
23
  {% assign update_list = update_list | push: entry %}
24
24
  {% endfor %}
25
+
26
+ {% if update_list.size > 0 %}
27
+
28
+ <div id="access-lastmod" class="post">
29
+ <div class="panel-heading">{{- site.data.locales[lang].panel.lastmod -}}</div>
30
+ <ul class="post-content pl-0 pb-1 ml-1 mt-2">
31
+ {% for item in update_list %}
32
+ {% assign index = item | split: "::" | last | plus: 0 %}
33
+ {% assign post = site.posts[index] %}
34
+ {% assign url = post.url | relative_url %}
35
+ <li><a href="{{ url }}">{{ post.title }}</a></li>
36
+ {% endfor %}
37
+ </ul>
38
+ </div> <!-- #access-lastmod -->
39
+
40
+ {% endif %}
@@ -13,10 +13,14 @@ layout: compress
13
13
  {% endif %}
14
14
  {% endcapture %}
15
15
 
16
- <html lang="{{ site.lang }}" {{ prefer_mode }}>
16
+ <html lang="{{ site.lang }}"{{ prefer_mode }}>
17
17
 
18
18
  {% include head.html %}
19
19
 
20
+ {% unless site.theme_mode %}
21
+ {% include mode-toggle.html %}
22
+ {% endunless %}
23
+
20
24
  <body data-spy="scroll" data-target="#toc">
21
25
 
22
26
  {% include sidebar.html %}
@@ -26,7 +30,7 @@ layout: compress
26
30
  <div id="main-wrapper">
27
31
  <div id="main">
28
32
 
29
- {% include refactor-content.html content=content %}
33
+ {{ content }}
30
34
 
31
35
  {% include footer.html %}
32
36
 
data/_layouts/home.html CHANGED
@@ -53,13 +53,13 @@ layout: page
53
53
  <div class="post-content">
54
54
  <p>
55
55
  {% include no-linenos.html content=post.content %}
56
- {{ content | markdownify | strip_html | truncate: 200 }}
56
+ {{ content | markdownify | strip_html | truncate: 200 | escape }}
57
57
  </p>
58
58
  </div>
59
59
 
60
- <div class="post-meta text-muted d-flex justify-content-between">
60
+ <div class="post-meta text-muted d-flex">
61
61
 
62
- <div>
62
+ <div class="mr-auto">
63
63
  <!-- posted date -->
64
64
  <i class="far fa-calendar fa-fw"></i>
65
65
  {% include timeago.html date=post.date tooltip=true %}
@@ -68,12 +68,15 @@ layout: page
68
68
  <i class="far fa-clock fa-fw"></i>
69
69
  {% include read-time.html content=post.content %}
70
70
 
71
- <!-- page views -->
72
- {% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
73
- <i class="far fa-eye fa-fw"></i>
74
- <span id="pv_{{-post.title-}}" class="pageviews">
75
- <i class="fas fa-spinner fa-spin fa-fw"></i>
76
- </span>
71
+ <!-- categories -->
72
+ {% if post.categories.size > 0 %}
73
+ <i class="far fa-folder-open fa-fw"></i>
74
+ <span>
75
+ {% for category in post.categories %}
76
+ {{ category }}
77
+ {%- unless forloop.last -%},{%- endunless -%}
78
+ {% endfor %}
79
+ </span>
77
80
  {% endif %}
78
81
  </div>
79
82