jekyll-text-theme 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -1
  3. data/README.md +11 -12
  4. data/_includes/article-footer/author-profile.html +1 -1
  5. data/_includes/article-list.html +3 -3
  6. data/_includes/extensions/codepen.html +4 -0
  7. data/_includes/extensions/youtube.html +1 -1
  8. data/_includes/scripts/article.js +1 -1
  9. data/_includes/scripts/{search-data.js → components/search/search-data.js} +0 -0
  10. data/_includes/scripts/{search.js → components/search/search.js} +0 -0
  11. data/_includes/scripts/lib/affix.js +83 -86
  12. data/_includes/scripts/lib/{scroll.js → scroll-to.js} +0 -0
  13. data/_includes/scripts/lib/swiper.js +150 -0
  14. data/_includes/scripts/lib/toc.js +83 -82
  15. data/_includes/scripts/variables.html +1 -1
  16. data/_includes/search.html +1 -1
  17. data/_includes/sharing-providers/addthis.html +9 -0
  18. data/_includes/sharing.html +3 -1
  19. data/_layouts/article.html +3 -1
  20. data/_layouts/landing.html +1 -1
  21. data/_layouts/page.html +19 -10
  22. data/_sass/additional/_alert.scss +4 -4
  23. data/_sass/common/_classes.scss +1 -1
  24. data/_sass/common/_function.scss +8 -0
  25. data/_sass/common/_print.scss +20 -0
  26. data/_sass/common/_reset.scss +5 -2
  27. data/_sass/common/_variables.scss +2 -4
  28. data/_sass/common/classes/_clickable.scss +21 -0
  29. data/_sass/common/classes/_display.scss +14 -3
  30. data/_sass/common/classes/_grid.scss +25 -76
  31. data/_sass/common/classes/_media.scss +2 -2
  32. data/_sass/common/classes/_pseudo.scss +8 -1
  33. data/_sass/common/classes/_shadow.scss +2 -2
  34. data/_sass/common/components/_button.scss +1 -7
  35. data/_sass/common/components/_card.scss +2 -2
  36. data/_sass/common/components/_hero.scss +1 -1
  37. data/_sass/common/components/_item.scss +14 -9
  38. data/_sass/common/components/_swiper.scss +45 -0
  39. data/_sass/common/components/_toc.scss +9 -9
  40. data/_sass/components/_article-content.scss +35 -17
  41. data/_sass/components/_article-header.scss +1 -1
  42. data/_sass/components/_article-info.scss +2 -2
  43. data/_sass/components/_article-list.scss +2 -2
  44. data/_sass/components/_author-profile.scss +7 -7
  45. data/_sass/components/_extensions.scss +8 -2
  46. data/_sass/components/_footer.scss +4 -4
  47. data/_sass/components/_header.scss +1 -1
  48. data/_sass/components/_search.scss +6 -6
  49. data/_sass/components/_tags.scss +1 -2
  50. data/_sass/custom.scss +0 -0
  51. data/_sass/layout/_404.scss +2 -2
  52. data/_sass/layout/_archive.scss +1 -1
  53. data/_sass/layout/_article.scss +5 -5
  54. data/_sass/layout/_articles.scss +1 -2
  55. data/_sass/layout/_home.scss +1 -1
  56. data/_sass/layout/_page.scss +12 -1
  57. data/assets/css/main.scss +5 -1
  58. data/assets/search.js +1 -1
  59. metadata +11 -5
@@ -1,95 +1,96 @@
1
1
  (function() {
2
2
  var SOURCES = window.TEXT_VARIABLES.sources;
3
3
  window.Lazyload.js(SOURCES.jquery, function() {
4
- var $window = $(window), $root, $scrollTarget, $scroller, $tocUl = $('<ul class="toc"></ul>'), $tocLi, $headings, $activeLast, $activeCur;
5
- var selectors = 'h1,h2,h3', container = 'body', scrollTarget = window, scroller = 'html, body', disabled = false;
6
- var headingsPos, scrolling = false, rendered = false, hasInit = false;
7
- function setOptions(options) {
8
- var _options = options || {};
9
- _options.selectors && (selectors = _options.selectors);
10
- _options.container && (container = _options.container);
11
- _options.scrollTarget && (scrollTarget = _options.scrollTarget);
12
- _options.scroller && (scroller = _options.scroller);
13
- _options.disabled !== undefined && (disabled = _options.disabled);
14
- $headings = $(container).find(selectors).filter('[id]');
15
- $scrollTarget = $(scrollTarget);
16
- $scroller = $(scroller);
17
- }
18
- function calc() {
19
- headingsPos = [];
20
- $headings.each(function() {
21
- headingsPos.push(Math.floor($(this).position().top));
22
- });
23
- }
24
- function setState(element, disabled) {
25
- var scrollTop = $scrollTarget.scrollTop(), i;
26
- if (disabled || !headingsPos || headingsPos.length < 1) { return; }
27
- if (element) {
28
- $activeCur = element;
29
- } else {
30
- for (i = 0; i < headingsPos.length; i++) {
31
- if (scrollTop >= headingsPos[i]) {
32
- $activeCur = $tocLi.eq(i);
33
- } else {
34
- $activeCur || ($activeCur = $tocLi.eq(i));
35
- break;
36
- }
37
- }
4
+ function toc(options) {
5
+ var $root = this, $window = $(window), $scrollTarget, $scroller, $tocUl = $('<ul class="toc"></ul>'), $tocLi, $headings, $activeLast, $activeCur,
6
+ selectors = 'h1,h2,h3', container = 'body', scrollTarget = window, scroller = 'html, body', disabled = false,
7
+ headingsPos, scrolling = false, hasRendered = false, hasInit = false;
8
+
9
+ function setOptions(options) {
10
+ var _options = options || {};
11
+ _options.selectors && (selectors = _options.selectors);
12
+ _options.container && (container = _options.container);
13
+ _options.scrollTarget && (scrollTarget = _options.scrollTarget);
14
+ _options.scroller && (scroller = _options.scroller);
15
+ _options.disabled !== undefined && (disabled = _options.disabled);
16
+ $headings = $(container).find(selectors).filter('[id]');
17
+ $scrollTarget = $(scrollTarget);
18
+ $scroller = $(scroller);
38
19
  }
39
- $activeLast && $activeLast.removeClass('active');
40
- ($activeLast = $activeCur).addClass('active');
41
- }
42
- function render() {
43
- if(!rendered) {
44
- $root.append($tocUl);
20
+ function calc() {
21
+ headingsPos = [];
45
22
  $headings.each(function() {
46
- var $this = $(this);
47
- $tocUl.append($('<li></li>').addClass('toc-' + $this.prop('tagName').toLowerCase())
48
- .append($('<a></a>').text($this.text()).attr('href', '#' + $this.prop('id'))));
23
+ headingsPos.push(Math.floor($(this).position().top));
49
24
  });
50
- $tocLi = $tocUl.children('li');
51
- $tocUl.on('click', 'a', function(e) {
52
- e.preventDefault();
53
- var $this = $(this);
54
- scrolling = true;
55
- setState($this.parent());
56
- $scroller.scrollToAnchor($this.attr('href'), 400, function() {
57
- scrolling = false;
25
+ }
26
+ function setState(element, disabled) {
27
+ var scrollTop = $scrollTarget.scrollTop(), i;
28
+ if (disabled || !headingsPos || headingsPos.length < 1) { return; }
29
+ if (element) {
30
+ $activeCur = element;
31
+ } else {
32
+ for (i = 0; i < headingsPos.length; i++) {
33
+ if (scrollTop >= headingsPos[i]) {
34
+ $activeCur = $tocLi.eq(i);
35
+ } else {
36
+ $activeCur || ($activeCur = $tocLi.eq(i));
37
+ break;
38
+ }
39
+ }
40
+ }
41
+ $activeLast && $activeLast.removeClass('active');
42
+ ($activeLast = $activeCur).addClass('active');
43
+ }
44
+ function render() {
45
+ if(!hasRendered) {
46
+ $root.append($tocUl);
47
+ $headings.each(function() {
48
+ var $this = $(this);
49
+ $tocUl.append($('<li></li>').addClass('toc-' + $this.prop('tagName').toLowerCase())
50
+ .append($('<a></a>').text($this.text()).attr('href', '#' + $this.prop('id'))));
58
51
  });
59
- });
52
+ $tocLi = $tocUl.children('li');
53
+ $tocUl.on('click', 'a', function(e) {
54
+ e.preventDefault();
55
+ var $this = $(this);
56
+ scrolling = true;
57
+ setState($this.parent());
58
+ $scroller.scrollToAnchor($this.attr('href'), 400, function() {
59
+ scrolling = false;
60
+ });
61
+ });
62
+ }
63
+ hasRendered = true;
60
64
  }
61
- rendered = true;
62
- }
63
- function init() {
64
- var interval, timeout;
65
- if(!hasInit) {
66
- render(); calc(); setState(null, scrolling);
67
- // run calc every 100 millisecond
68
- interval = setInterval(function() {
69
- calc();
70
- }, 100);
71
- timeout = setTimeout(function() {
72
- clearInterval(interval);
73
- }, 45000);
74
- window.pageLoad.then(function() {
75
- setTimeout(function() {
65
+ function init() {
66
+ var interval, timeout;
67
+ if(!hasInit) {
68
+ render(); calc(); setState(null, scrolling);
69
+ // run calc every 100 millisecond
70
+ interval = setInterval(function() {
71
+ calc();
72
+ }, 100);
73
+ timeout = setTimeout(function() {
76
74
  clearInterval(interval);
77
- clearTimeout(timeout);
78
- }, 3000);
79
- });
80
- $scrollTarget.on('scroll', function() {
81
- disabled || setState(null, scrolling);
82
- });
83
- $window.on('resize', window.throttle(function() {
84
- if (!disabled) {
85
- render(); calc(); setState(null, scrolling);
86
- }
87
- }, 100));
75
+ }, 45000);
76
+ window.pageLoad.then(function() {
77
+ setTimeout(function() {
78
+ clearInterval(interval);
79
+ clearTimeout(timeout);
80
+ }, 3000);
81
+ });
82
+ $scrollTarget.on('scroll', function() {
83
+ disabled || setState(null, scrolling);
84
+ });
85
+ $window.on('resize', window.throttle(function() {
86
+ if (!disabled) {
87
+ render(); calc(); setState(null, scrolling);
88
+ }
89
+ }, 100));
90
+ }
91
+ hasInit = true;
88
92
  }
89
- hasInit = true;
90
- }
91
- function toc(options) {
92
- $root = this;
93
+
93
94
  setOptions(options);
94
95
  if (!disabled) {
95
96
  init();
@@ -7,7 +7,7 @@
7
7
  <script>
8
8
  (function() {
9
9
  var TEXT_VARIABLES = {
10
- version: '2.2.2',
10
+ version: '2.2.3',
11
11
  sources: {
12
12
  font_awesome: '{{ _sources.font_awesome }}',
13
13
  jquery: '{{ _sources.jquery }}',
@@ -21,4 +21,4 @@
21
21
  </div>
22
22
  </div>
23
23
 
24
- <script>{%- include scripts/search.js -%}</script>
24
+ <script>{%- include scripts/components/search/search.js -%}</script>
@@ -0,0 +1,9 @@
1
+ <!-- Addthis BEGIN -->
2
+ {%- assign _SHARING_ADDTHIS_ID = site.sharing.addthis.id -%}
3
+
4
+ {%- if _SHARING_ADDTHIS_ID -%}
5
+ <script type="text/javascript"
6
+ src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{ _SHARING_ADDTHIS_ID }}"></script>
7
+ <div class="addthis_inline_share_toolbox addthis_default_style"></div>
8
+ {%- endif -%}
9
+ <!-- Addthis END -->
@@ -1,3 +1,5 @@
1
1
  {%- if site.sharing.provider == 'addtoany' -%}
2
2
  {%- include sharing-providers/addtoany.html -%}
3
- {%- endif -%}
3
+ {%- elsif site.sharing.provider == 'addthis' -%}
4
+ {%- include sharing-providers/addthis.html -%}
5
+ {%- endif -%}
@@ -24,7 +24,7 @@ type: article
24
24
  <div class="article__content" itemprop="articleBody">{{ content }}</div>
25
25
 
26
26
  {%- if _sharing != false -%}
27
- <section class="article__sharing">{%- include sharing.html -%}</section>
27
+ <section class="article__sharing d-print-none">{%- include sharing.html -%}</section>
28
28
  {%- endif -%}
29
29
 
30
30
  <footer class="article__footer">
@@ -65,7 +65,9 @@ type: article
65
65
  {%- endif -%}
66
66
  </footer>
67
67
 
68
+ <div class="d-print-none">
68
69
  {%- include article-section-navigator.html -%}
70
+ </div>
69
71
 
70
72
  </div>
71
73
 
@@ -52,7 +52,7 @@ article_header:
52
52
  <div class="grid grid--p-3">
53
53
 
54
54
  {%- for child in _section.children -%}
55
- <div class="cell cell--{{ 12 | divided_by: _size }} cell--sm-12">
55
+ <div class="cell cell--12 cell--md-{{ 12 | divided_by: _size }} ">
56
56
 
57
57
  <div class="mb-5">
58
58
  <h4>{{ child.title }}</h4>
@@ -9,6 +9,10 @@ layout: base
9
9
  target=layout.header source0=page.header -%}
10
10
  {%- assign _header = __return -%}
11
11
 
12
+ {%- include snippets/assign.html
13
+ target=layout.footer source0=page.footer -%}
14
+ {%- assign _footer = __return -%}
15
+
12
16
  {%- include snippets/assign.html
13
17
  target = site.data.variables.default.page.full_width
14
18
  source0=layout.full_width source1=page.full_width -%}
@@ -24,9 +28,9 @@ layout: base
24
28
 
25
29
  {%- if page.sidebar -%}
26
30
  <div class="layout--page layout--page--sidebar clearfix js-page-root">
27
- <div class="page__mask js-page-mask js-sidebar-hide"></div>
31
+ <div class="page__mask d-print-none js-page-mask js-sidebar-hide"></div>
28
32
  <div class="page__viewport">
29
- <div class="page__actions">
33
+ <div class="page__actions d-print-none">
30
34
  <div class="button button--circle button--lg box-shadow-2 sidebar-button js-sidebar-show">
31
35
  <i class="fas fa-bars icon--show"></i>
32
36
  </div>
@@ -34,7 +38,7 @@ layout: base
34
38
 
35
39
  <div class="grid page__grid">
36
40
 
37
- <div class="page__sidebar">
41
+ <div class="page__sidebar d-print-none">
38
42
  {%- include sidebar/toc.html -%}
39
43
  </div>
40
44
 
@@ -49,6 +53,9 @@ layout: base
49
53
  {%- unless page.sidebar -%}
50
54
  {%- assign _page_main_class = _page_main_class | append: ' page__viewport' -%}
51
55
  {%- endunless -%}
56
+ {%- if _footer == false -%}
57
+ {%- assign _page_main_class = _page_main_class | append: ' hide-footer' -%}
58
+ {%- endif -%}
52
59
  {%- if page.aside -%}
53
60
  {%- assign _page_main_class = _page_main_class | append: ' has-aside' -%}
54
61
  {%- elsif _full_width -%}
@@ -59,7 +66,7 @@ layout: base
59
66
  <div class="page__main-inner">
60
67
  <div></div>
61
68
  {%- if _header != false -%}
62
- <div class="page__header">
69
+ <div class="page__header d-print-none">
63
70
  {%- assign _header_theme = page.header.theme | default: layout.header.theme -%}
64
71
  {%- if _header_theme == 'dark'-%}
65
72
  {%- include header.html theme='dark' background=page.header.background -%}
@@ -173,7 +180,7 @@ layout: base
173
180
  {%- endif -%}
174
181
  <div class="grid grid--reverse">
175
182
 
176
- <div class="col-aside js-col-aside">
183
+ <div class="col-aside d-print-none js-col-aside">
177
184
  {%- if page.aside -%}
178
185
  <aside class="page__aside js-page-aside">
179
186
  {%- include aside/toc.html -%}
@@ -181,7 +188,7 @@ layout: base
181
188
  {%- endif -%}
182
189
  </div>
183
190
 
184
- <div class="col-main cell--auto">
191
+ <div class="col-main cell cell--auto">
185
192
  {%- if _page_type == 'article' -%}
186
193
  <article itemscope itemtype="http://schema.org/Article">
187
194
  {%- elsif _page_type == 'webpage' -%}
@@ -200,7 +207,7 @@ layout: base
200
207
 
201
208
  <div class="js-article-content">{{ content }}</div>
202
209
  {%- if _comment != false -%}
203
- <section class="page__comments">{%- include comments.html -%}</section>
210
+ <section class="page__comments d-print-none">{%- include comments.html -%}</section>
204
211
  {%- endif -%}
205
212
  </article>
206
213
  </div>
@@ -211,7 +218,9 @@ layout: base
211
218
  {%- endif -%}
212
219
  </div>
213
220
 
214
- <div class="page__footer">{%- include footer.html -%}</div>
221
+ {%- if _footer != false -%}
222
+ <div class="page__footer d-print-none">{%- include footer.html -%}</div>
223
+ {%- endif -%}
215
224
  </div>
216
225
  </div> {%- comment -%} end page__main {%- endcomment -%}
217
226
  {%- if page.sidebar -%}
@@ -219,13 +228,13 @@ layout: base
219
228
  </div> {%- comment -%} end page__viewport {%- endcomment -%}
220
229
  {%- endif -%}
221
230
  {%- if _header != false -%}
222
- <div class="page__search-panel">{%- include search.html -%}</div>
231
+ <div class="page__search-panel d-print-none"">{%- include search.html -%}</div>
223
232
  {%- endif -%}
224
233
  </div>
225
234
 
226
235
 
227
236
  <script>
228
- {%- include scripts/lib/scroll.js -%}
237
+ {%- include scripts/lib/scroll-to.js -%}
229
238
  {%- include scripts/lib/affix.js -%}
230
239
  {%- include scripts/lib/toc.js -%}
231
240
  {%- include scripts/page.js -%}
@@ -1,27 +1,27 @@
1
1
  .article__content {
2
2
  p.success {
3
- padding: .5rem 1rem;
3
+ padding: map-get($spacers, 2) map-get($spacers, 3);
4
4
  background-color: rgba($green, .1);
5
5
  border: 1px solid $green;
6
6
  border-radius: map-get($base, border-radius);
7
7
  }
8
8
 
9
9
  p.info {
10
- padding: .5rem 1rem;
10
+ padding: map-get($spacers, 2) map-get($spacers, 3);
11
11
  background-color: rgba($blue, .1);
12
12
  border: 1px solid $blue;
13
13
  border-radius: map-get($base, border-radius);
14
14
  }
15
15
 
16
16
  p.warning {
17
- padding: .5rem 1rem;
17
+ padding: map-get($spacers, 2) map-get($spacers, 3);
18
18
  background-color: rgba($yellow, .1);
19
19
  border: 1px solid $yellow;
20
20
  border-radius: map-get($base, border-radius);
21
21
  }
22
22
 
23
23
  p.error {
24
- padding: .5rem 1rem;
24
+ padding: map-get($spacers, 2) map-get($spacers, 3);
25
25
  background-color: rgba($red, .1);
26
26
  border: 1px solid $red;
27
27
  border-radius: map-get($base, border-radius);
@@ -3,6 +3,7 @@
3
3
  @import
4
4
  "common/classes/animation",
5
5
  "common/classes/clearfix",
6
+ "common/classes/media",
6
7
  "common/classes/clickable",
7
8
  "common/classes/display",
8
9
  "common/classes/flex",
@@ -10,7 +11,6 @@
10
11
  "common/classes/pseudo",
11
12
  "common/classes/link",
12
13
  "common/classes/text",
13
- "common/classes/media",
14
14
  "common/classes/overflow",
15
15
  "common/classes/shadow",
16
16
  "common/classes/spacing",
@@ -4,4 +4,12 @@
4
4
  } @else {
5
5
  @return "light";
6
6
  }
7
+ }
8
+
9
+ @function breakpoint-infix($name, $breakpoints: default) {
10
+ @if $breakpoints == default {
11
+ $breakpoints: $responsive;
12
+ }
13
+ $min: map-get($breakpoints, $name);
14
+ @return if($min != 0, "#{$name}-", "");
7
15
  }
@@ -0,0 +1,20 @@
1
+ @media print {
2
+ a {
3
+ @include plain() {
4
+ text-decoration: underline;
5
+ }
6
+ @include hover() {
7
+ text-decoration: underline;
8
+ }
9
+ @include active() {
10
+ text-decoration: underline;
11
+ }
12
+ }
13
+
14
+ img,
15
+ tr,
16
+ pre,
17
+ blockquote {
18
+ page-break-inside: avoid;
19
+ }
20
+ }
@@ -26,6 +26,9 @@ html {
26
26
  height: 100%;
27
27
  font-size: map-get($base, font-size-root);
28
28
  -webkit-text-size-adjust: 100%; /* 1 */
29
+ @media print {
30
+ font-size: map-get($base, font-size-root-sm);
31
+ }
29
32
  }
30
33
 
31
34
  body {
@@ -35,7 +38,7 @@ body {
35
38
 
36
39
  @include block-elements() {
37
40
  padding: 0;
38
- margin: map-get($base, vertical-space) 0;
41
+ margin: map-get($spacers, 2) 0;
39
42
  }
40
43
 
41
44
  body {
@@ -150,7 +153,7 @@ figcaption {
150
153
  button {
151
154
  padding: 0;
152
155
  margin: 0;
153
- font-size: 1rem;
156
+ font-size: map-get($spacers, 3);
154
157
  cursor: pointer;
155
158
  background-color: transparent;
156
159
  border-width: 0;