jekyll-theme-yat 1.2.1 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93dc2f7abbfa41173758255019dbe3a682aac9ec78650e0f215c262c1c8a7a0c
4
- data.tar.gz: 591a837850ff6cbf79b66103e7a7aaba845a62d539fe198a2565142b7aa7c1a6
3
+ metadata.gz: 5e50a9c1dc813ef81f78d8657642ed0ad82e058b2a3d37431c2a2baf17ed99af
4
+ data.tar.gz: 1280a0e558630797445e27b4852262aa3809b2f3d2ff60154b6a966fce34fd23
5
5
  SHA512:
6
- metadata.gz: 543fbfe705ba586521ea4899f1f3d20efc27ded17fb4fd23116bd129c80227429fcd9773d2327c8a8de783c0f0e5e419288cc757177a19fbc25898e4c138bc13
7
- data.tar.gz: 75c1cf6c57f51b4d08c2eb2afe69187a4e6fccdefe1188bfcfa6dc246184951d33a257acdd54eef9280dbd668ce9b1780e7b26e2fcd56408be0b9f6bc6f98314
6
+ metadata.gz: 351e0b176594ebbbe3d70f05c91f0abd6d2b2d6d79e246050dfea541dc7335f3e88d999d7cd419c486fd92664819ee587f103615304269208db1f081984f3f82
7
+ data.tar.gz: 076e94ae4d9b3c4c40af4f3fe66e08452d043e9423820f4684b5eb95f8b3a1c0488fe2cf0c851f8540cda31b0007471d8d302d9f1f1b0757df7c2bcb91a323f5
@@ -13,9 +13,15 @@
13
13
 
14
14
  <script>
15
15
  function generateContent() {
16
- var menu = document.querySelector(".post-menu .post-menu-content");
16
+ var menu = document.querySelector(".post-menu");
17
+ var menuContent = menu.querySelector(".post-menu-content");
17
18
  var headings = document.querySelector(".post-content").querySelectorAll("h2, h3, h4, h5, h6");
18
19
 
20
+ // Hide menu when no headings
21
+ if (headings.length === 0) {
22
+ return menu.style.display = "none";
23
+ }
24
+
19
25
  // Generate post menu
20
26
  var menuHTML = '';
21
27
  for (var i = 0; i < headings.length; i++) {
@@ -25,14 +31,14 @@
25
31
  + '<a href="#h-' + h.getAttribute('id') + '">' + h.textContent + '</a></li>');
26
32
  }
27
33
 
28
- menu.innerHTML = '<ul>' + menuHTML + '</ul>';
34
+ menuContent.innerHTML = '<ul>' + menuHTML + '</ul>';
29
35
 
30
36
  // The header element
31
37
  var header = document.querySelector('header.site-header');
32
38
 
33
39
  // Active the menu item
34
40
  window.addEventListener('scroll', function (event) {
35
- var lastActive = menu.querySelector('.active');
41
+ var lastActive = menuContent.querySelector('.active');
36
42
  var changed = true;
37
43
  for (var i = headings.length - 1; i >= 0; i--) {
38
44
  var h = headings[i];
@@ -43,7 +49,7 @@
43
49
  var headerHeight = headerTop + headerHeight + 20;
44
50
  if (headingRect.top <= headerHeight) {
45
51
  var id = 'h-' + h.getAttribute('id');
46
- var curActive = menu.querySelector('a[href="#' + id + '"]');
52
+ var curActive = menuContent.querySelector('a[href="#' + id + '"]');
47
53
  if (curActive) {
48
54
  curActive.classList.add('active');
49
55
  }
@@ -6,6 +6,4 @@
6
6
 
7
7
  </div>
8
8
 
9
- <div>
10
-
11
9
  </article>
@@ -11,4 +11,4 @@ sidebar: category-list
11
11
  {{ content }}
12
12
 
13
13
  {% include views/pagination.html %}
14
- <div>
14
+ </div>
data/_layouts/post.html CHANGED
@@ -7,47 +7,45 @@ sidebar:
7
7
  ---
8
8
 
9
9
  <div class="post">
10
- <section>
10
+ <section>
11
11
 
12
- {%- assign name = 'banner' -%}
13
- {%- include functions.html func='get_value' -%}
14
- {%- assign banner = return -%}
12
+ {%- assign name = 'banner' -%}
13
+ {%- include functions.html func='get_value' -%}
14
+ {%- assign banner = return -%}
15
15
 
16
- {%- if banner == nil -%}
17
- {%- include views/post-header.html -%}
18
- {%- endif -%}
19
-
20
- {%- include views/article.html -%}
16
+ {%- if banner == nil -%}
17
+ {%- include views/post-header.html -%}
18
+ {%- endif -%}
21
19
 
22
- <div class="post-nav">
23
- {%- if page.previous -%}
24
- <a href="{{ page.previous.url }}" title="{{ page.previous.title | escape }}">&laquo; Prev</a>
25
- {%- else -%}
26
- <span></span>
27
- {%- endif -%}
20
+ {%- include views/article.html -%}
28
21
 
29
- {%- if page.next -%}
30
- <a href="{{ page.next.url }}" title="{{ page.next.title | escape }}">Next &raquo;</a>
31
- {%- else -%}
32
- <span></span>
33
- {%- endif -%}
34
- </div>
22
+ <div class="post-nav">
23
+ {%- if page.previous -%}
24
+ <a href="{{ page.previous.url }}" title="{{ page.previous.title | escape }}">&laquo; Prev</a>
25
+ {%- else -%}
26
+ <span></span>
27
+ {%- endif -%}
35
28
 
36
- {%- if page.comments != false -%}
29
+ {%- if page.next -%}
30
+ <a href="{{ page.next.url }}" title="{{ page.next.title | escape }}">Next &raquo;</a>
31
+ {%- else -%}
32
+ <span></span>
33
+ {%- endif -%}
34
+ </div>
37
35
 
38
- {%- if site.disqus.shortname -%}
39
- {%- include extensions/comments/disqus.html -%}
40
- {%- endif -%}
36
+ {%- if page.comments != false -%}
41
37
 
42
- {%- if site.gitment.username -%}
43
- {%- include extensions/comments/gitment.html -%}
44
- {%- endif -%}
38
+ {%- if site.disqus.shortname -%}
39
+ {%- include extensions/comments/disqus.html -%}
40
+ {%- endif -%}
45
41
 
46
- {%- endif -%}
42
+ {%- if site.gitment.username -%}
43
+ {%- include extensions/comments/gitment.html -%}
44
+ {%- endif -%}
47
45
 
48
- </section>
46
+ {%- endif -%}
49
47
 
50
- {%- include extensions/mathjax.html -%}
48
+ </section>
51
49
  </div>
52
50
 
53
51
 
data/_sass/yat/_base.scss CHANGED
@@ -207,20 +207,23 @@ table {
207
207
  text-align: $table-text-align;
208
208
  color: lighten($text-color, 18%);
209
209
  border-collapse: collapse;
210
- border: 1px solid $grey-color-light;
210
+
211
211
  tr {
212
212
  &:nth-child(even) {
213
213
  background-color: lighten($grey-color-light, 6%);
214
214
  }
215
215
  }
216
+
216
217
  th, td {
217
218
  padding: ($spacing-unit / 3) ($spacing-unit / 2);
218
219
  }
220
+
219
221
  th {
220
222
  background-color: lighten($grey-color-light, 3%);
221
223
  border: 1px solid darken($grey-color-light, 4%);
222
224
  border-bottom-color: darken($grey-color-light, 12%);
223
225
  }
226
+
224
227
  td {
225
228
  border: 1px solid $grey-color-light;
226
229
  }
@@ -243,6 +246,10 @@ table {
243
246
  */
244
247
  @mixin flex-sticky($top) {
245
248
  position: sticky;
249
+ position: -moz-sticky; /* <-- fix sticky compatibility issue */
250
+ position: -ms-sticky;
251
+ position: -o-sticky;
252
+ position: -webkit-sticky;
246
253
  align-self: flex-start; /* <-- fix the sticky not work issue */
247
254
  transform: scale(0.9999); /* <-- fix the sticky x overflow issue */
248
255
  top: $top;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-yat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffreytse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-24 00:00:00.000000000 Z
11
+ date: 2019-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: jekyll-spaceship
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.1'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.1'
111
125
  description:
112
126
  email:
113
127
  - jeffreytse.mail@gmail.com
@@ -188,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
202
  - !ruby/object:Gem::Version
189
203
  version: '0'
190
204
  requirements: []
191
- rubygems_version: 3.0.3
205
+ rubygems_version: 3.0.6
192
206
  signing_key:
193
207
  specification_version: 4
194
208
  summary: Yet another theme for personal writers.