jekyll-text-theme-fork 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +235 -0
  3. data/LICENSE +21 -0
  4. data/README.md +89 -0
  5. data/_data/authors.yml +0 -0
  6. data/_data/licenses.yml +16 -0
  7. data/_data/locale.yml +169 -0
  8. data/_data/navigation.yml +52 -0
  9. data/_data/variables.yml +64 -0
  10. data/_includes/analytics-providers/custom.html +3 -0
  11. data/_includes/analytics-providers/google.html +14 -0
  12. data/_includes/analytics.html +7 -0
  13. data/_includes/article/footer/author-profile.html +47 -0
  14. data/_includes/article/footer/custom.html +3 -0
  15. data/_includes/article/footer/license.html +14 -0
  16. data/_includes/article/footer/subscribe.html +6 -0
  17. data/_includes/article/top/custom.html +3 -0
  18. data/_includes/article-footer.html +55 -0
  19. data/_includes/article-header.html +49 -0
  20. data/_includes/article-info.html +96 -0
  21. data/_includes/article-list.html +144 -0
  22. data/_includes/article-section-navigator.html +54 -0
  23. data/_includes/aside/toc.html +1 -0
  24. data/_includes/author-links.html +120 -0
  25. data/_includes/comments-providers/custom.html +3 -0
  26. data/_includes/comments-providers/disqus.html +22 -0
  27. data/_includes/comments-providers/gitalk.html +39 -0
  28. data/_includes/comments-providers/valine.html +46 -0
  29. data/_includes/comments.html +11 -0
  30. data/_includes/extensions/bilibili.html +5 -0
  31. data/_includes/extensions/codepen.html +4 -0
  32. data/_includes/extensions/netease-cloud-music.html +4 -0
  33. data/_includes/extensions/slideshare.html +6 -0
  34. data/_includes/extensions/soundcloud.html +4 -0
  35. data/_includes/extensions/ted.html +5 -0
  36. data/_includes/extensions/youtube.html +4 -0
  37. data/_includes/footer.html +37 -0
  38. data/_includes/head/custom.html +3 -0
  39. data/_includes/head/favicon.html +26 -0
  40. data/_includes/head.html +24 -0
  41. data/_includes/header.html +44 -0
  42. data/_includes/main/bottom/custom.html +3 -0
  43. data/_includes/main/top/custom.html +3 -0
  44. data/_includes/markdown-enhancements/chart.html +15 -0
  45. data/_includes/markdown-enhancements/mathjax.html +17 -0
  46. data/_includes/markdown-enhancements/mermaid.html +10 -0
  47. data/_includes/markdown-enhancements.html +17 -0
  48. data/_includes/pageview-providers/custom/home.html +3 -0
  49. data/_includes/pageview-providers/custom/post.html +3 -0
  50. data/_includes/pageview-providers/leancloud/home.html +35 -0
  51. data/_includes/pageview-providers/leancloud/leancloud.js +72 -0
  52. data/_includes/pageview-providers/leancloud/post.html +31 -0
  53. data/_includes/pageview.html +29 -0
  54. data/_includes/paginator.html +98 -0
  55. data/_includes/scripts/archieve.js +135 -0
  56. data/_includes/scripts/article.js +24 -0
  57. data/_includes/scripts/aside/affix.js +26 -0
  58. data/_includes/scripts/aside/toc.js +35 -0
  59. data/_includes/scripts/common.js +7 -0
  60. data/_includes/scripts/components/lightbox.js +49 -0
  61. data/_includes/scripts/components/search.js +86 -0
  62. data/_includes/scripts/components/sidebar.js +30 -0
  63. data/_includes/scripts/home.js +3 -0
  64. data/_includes/scripts/lib/affix.js +111 -0
  65. data/_includes/scripts/lib/gallery.js +192 -0
  66. data/_includes/scripts/lib/lazyload.js +143 -0
  67. data/_includes/scripts/lib/modal.js +64 -0
  68. data/_includes/scripts/lib/scroll-to.js +13 -0
  69. data/_includes/scripts/lib/swiper.js +203 -0
  70. data/_includes/scripts/lib/throttle.js +28 -0
  71. data/_includes/scripts/lib/toc.js +107 -0
  72. data/_includes/scripts/page.js +3 -0
  73. data/_includes/scripts/utils/imagesLoad.js +28 -0
  74. data/_includes/scripts/utils/utils.js +39 -0
  75. data/_includes/scripts/variables.html +35 -0
  76. data/_includes/search-providers/custom/search.html +3 -0
  77. data/_includes/search-providers/default/search-data.js +14 -0
  78. data/_includes/search-providers/default/search.html +18 -0
  79. data/_includes/search-providers/default/search.js +112 -0
  80. data/_includes/search-providers/google-custom-search-engine/search.html +21 -0
  81. data/_includes/search-providers/google-custom-search-engine/search.js +33 -0
  82. data/_includes/search.html +20 -0
  83. data/_includes/sharing-providers/addthis.html +9 -0
  84. data/_includes/sharing-providers/addtoany.html +10 -0
  85. data/_includes/sharing-providers/custom.html +3 -0
  86. data/_includes/sharing.html +7 -0
  87. data/_includes/sidebar/toc.html +25 -0
  88. data/_includes/snippets/assign.html +9 -0
  89. data/_includes/snippets/get-article-title.html +11 -0
  90. data/_includes/snippets/get-lang.html +6 -0
  91. data/_includes/snippets/get-locale-string.html +12 -0
  92. data/_includes/snippets/get-nav-url.html +8 -0
  93. data/_includes/snippets/get-sources.html +2 -0
  94. data/_includes/snippets/get-string-from-locale-config.html +7 -0
  95. data/_includes/snippets/is_collection.html +6 -0
  96. data/_includes/snippets/page-url.html +2 -0
  97. data/_includes/snippets/prepend-baseurl.html +4 -0
  98. data/_includes/snippets/prepend-path.html +1 -0
  99. data/_includes/svg/icon/social/behance.svg +3 -0
  100. data/_includes/svg/icon/social/douban.svg +5 -0
  101. data/_includes/svg/icon/social/facebook.svg +3 -0
  102. data/_includes/svg/icon/social/flicker.svg +5 -0
  103. data/_includes/svg/icon/social/github.svg +3 -0
  104. data/_includes/svg/icon/social/googleplus.svg +3 -0
  105. data/_includes/svg/icon/social/linkedin.svg +3 -0
  106. data/_includes/svg/icon/social/mail.svg +6 -0
  107. data/_includes/svg/icon/social/medium.svg +3 -0
  108. data/_includes/svg/icon/social/npm.svg +9 -0
  109. data/_includes/svg/icon/social/pinterest.svg +3 -0
  110. data/_includes/svg/icon/social/qq.svg +3 -0
  111. data/_includes/svg/icon/social/telegram.svg +4 -0
  112. data/_includes/svg/icon/social/twitter.svg +3 -0
  113. data/_includes/svg/icon/social/weibo.svg +6 -0
  114. data/_includes/svg/icon/social/weixin.svg +3 -0
  115. data/_includes/svg/icon/social/zhihu.svg +3 -0
  116. data/_includes/svg/logo.svg +8 -0
  117. data/_includes/tags.html +52 -0
  118. data/_layouts/404.html +13 -0
  119. data/_layouts/archive.html +40 -0
  120. data/_layouts/article.html +29 -0
  121. data/_layouts/articles.html +89 -0
  122. data/_layouts/base.html +25 -0
  123. data/_layouts/home.html +43 -0
  124. data/_layouts/landing.html +178 -0
  125. data/_layouts/none.html +1 -0
  126. data/_layouts/page.html +270 -0
  127. data/_sass/additional/_alert.scss +29 -0
  128. data/_sass/additional/_photo-frame.scss +17 -0
  129. data/_sass/additional/_tag.scss +21 -0
  130. data/_sass/animate/_fade-in-down.scss +10 -0
  131. data/_sass/animate/_fade-in-up.scss +10 -0
  132. data/_sass/animate/_fade-in.scss +8 -0
  133. data/_sass/common/_classes.scss +24 -0
  134. data/_sass/common/_function.scss +15 -0
  135. data/_sass/common/_print.scss +20 -0
  136. data/_sass/common/_reset.scss +174 -0
  137. data/_sass/common/_variables.scss +150 -0
  138. data/_sass/common/classes/_animation.scss +13 -0
  139. data/_sass/common/classes/_clearfix.scss +19 -0
  140. data/_sass/common/classes/_clickable.scss +159 -0
  141. data/_sass/common/classes/_display.scss +13 -0
  142. data/_sass/common/classes/_flex.scss +394 -0
  143. data/_sass/common/classes/_grid.scss +80 -0
  144. data/_sass/common/classes/_horizontal-rules.scss +14 -0
  145. data/_sass/common/classes/_link.scss +12 -0
  146. data/_sass/common/classes/_media.scss +17 -0
  147. data/_sass/common/classes/_overflow.scss +26 -0
  148. data/_sass/common/classes/_pseudo.scss +33 -0
  149. data/_sass/common/classes/_shadow.scss +22 -0
  150. data/_sass/common/classes/_spacing.scss +81 -0
  151. data/_sass/common/classes/_split-line.scss +24 -0
  152. data/_sass/common/classes/_text.scss +37 -0
  153. data/_sass/common/classes/_transform.scss +4 -0
  154. data/_sass/common/classes/_transition.scss +4 -0
  155. data/_sass/common/classes/_user-select.scss +6 -0
  156. data/_sass/common/components/_button.scss +163 -0
  157. data/_sass/common/components/_card.scss +103 -0
  158. data/_sass/common/components/_gallery.scss +21 -0
  159. data/_sass/common/components/_hero.scss +70 -0
  160. data/_sass/common/components/_image.scss +19 -0
  161. data/_sass/common/components/_item.scss +100 -0
  162. data/_sass/common/components/_menu.scss +67 -0
  163. data/_sass/common/components/_modal.scss +39 -0
  164. data/_sass/common/components/_swiper.scss +48 -0
  165. data/_sass/common/components/_toc.scss +124 -0
  166. data/_sass/components/_article-content.scss +221 -0
  167. data/_sass/components/_article-footer.scss +17 -0
  168. data/_sass/components/_article-header.scss +50 -0
  169. data/_sass/components/_article-info.scss +25 -0
  170. data/_sass/components/_article-list.scss +18 -0
  171. data/_sass/components/_author-links.scss +43 -0
  172. data/_sass/components/_author-profile.scss +26 -0
  173. data/_sass/components/_extensions.scss +35 -0
  174. data/_sass/components/_footer.scss +33 -0
  175. data/_sass/components/_header.scss +123 -0
  176. data/_sass/components/_lightbox.scss +7 -0
  177. data/_sass/components/_main.scss +28 -0
  178. data/_sass/components/_search.scss +186 -0
  179. data/_sass/components/_tags.scss +24 -0
  180. data/_sass/custom.scss +3 -0
  181. data/_sass/layout/_404.scss +14 -0
  182. data/_sass/layout/_archive.scss +5 -0
  183. data/_sass/layout/_article.scss +29 -0
  184. data/_sass/layout/_articles.scss +17 -0
  185. data/_sass/layout/_base.scss +6 -0
  186. data/_sass/layout/_home.scss +15 -0
  187. data/_sass/layout/_landing.scss +23 -0
  188. data/_sass/layout/_page.scss +165 -0
  189. data/_sass/skins/_chocolate.scss +74 -0
  190. data/_sass/skins/_dark.scss +74 -0
  191. data/_sass/skins/_default.scss +74 -0
  192. data/_sass/skins/_forest.scss +74 -0
  193. data/_sass/skins/_ocean.scss +74 -0
  194. data/_sass/skins/_orange.scss +74 -0
  195. data/_sass/skins/highlight/_default.scss +0 -0
  196. data/_sass/skins/highlight/_tomorrow-night-blue.scss +2 -0
  197. data/_sass/skins/highlight/_tomorrow-night-bright.scss +2 -0
  198. data/_sass/skins/highlight/_tomorrow-night-eighties.scss +2 -0
  199. data/_sass/skins/highlight/_tomorrow-night.scss +2 -0
  200. data/_sass/skins/highlight/_tomorrow.scss +2 -0
  201. data/_sass/skins/highlight/tomorrow/_default.scss +10 -0
  202. data/_sass/skins/highlight/tomorrow/_highlight.scss +74 -0
  203. data/_sass/skins/highlight/tomorrow/_night-blue.scss +10 -0
  204. data/_sass/skins/highlight/tomorrow/_night-bright.scss +10 -0
  205. data/_sass/skins/highlight/tomorrow/_night-eighties.scss +10 -0
  206. data/_sass/skins/highlight/tomorrow/_night.scss +10 -0
  207. data/assets/android-chrome-192x192.png +0 -0
  208. data/assets/android-chrome-512x512.png +0 -0
  209. data/assets/apple-touch-icon.png +0 -0
  210. data/assets/browserconfig.xml +9 -0
  211. data/assets/css/main.scss +74 -0
  212. data/assets/favicon-16x16.png +0 -0
  213. data/assets/favicon-32x32.png +0 -0
  214. data/assets/favicon.ico +0 -0
  215. data/assets/images/logo/logo.svg +8 -0
  216. data/assets/mstile-144x144.png +0 -0
  217. data/assets/mstile-150x150.png +0 -0
  218. data/assets/mstile-310x150.png +0 -0
  219. data/assets/mstile-310x310.png +0 -0
  220. data/assets/mstile-70x70.png +0 -0
  221. data/assets/safari-pinned-tab.svg +38 -0
  222. data/assets/search.js +3 -0
  223. data/assets/site.webmanifest +19 -0
  224. metadata +371 -0
@@ -0,0 +1,107 @@
1
+ (function() {
2
+ var SOURCES = window.TEXT_VARIABLES.sources;
3
+ window.Lazyload.js(SOURCES.jquery, function() {
4
+ function toc(options) {
5
+ var $root = this, $window = $(window), $scrollTarget, $scroller, $tocUl = $('<ul class="toc toc--ellipsis"></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);
19
+ }
20
+ function calc() {
21
+ headingsPos = [];
22
+ $headings.each(function() {
23
+ headingsPos.push(Math.floor($(this).position().top));
24
+ });
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'))));
51
+ });
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;
64
+ }
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() {
74
+ clearInterval(interval);
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;
92
+ }
93
+
94
+ setOptions(options);
95
+ if (!disabled) {
96
+ init();
97
+ }
98
+ $window.on('resize', window.throttle(function() {
99
+ init();
100
+ }, 200));
101
+ return {
102
+ setOptions: setOptions
103
+ };
104
+ }
105
+ $.fn.toc = toc;
106
+ });
107
+ })();
@@ -0,0 +1,3 @@
1
+ /*(function () {
2
+
3
+ })();*/
@@ -0,0 +1,28 @@
1
+ (function() {
2
+ window.imagesLoad = function(images) {
3
+ images = images || document.getElementsByTagName('img');
4
+ var imagesCount = images.length, loadedCount = 0, image;
5
+ var i, j, loaded = false, cbs = [];
6
+ imagesCount < 1 && (loaded = true);
7
+ for (i = 0; i < imagesCount; i++) {
8
+ image = images[i];
9
+ image.complete ? handleImageLoad() : image.addEventListener('load', handleImageLoad);
10
+ }
11
+ function handleImageLoad() {
12
+ loadedCount++;
13
+ if (loadedCount === imagesCount) {
14
+ loaded = true;
15
+ if (cbs.length > 0) {
16
+ for (j = 0; j < cbs.length; j++) {
17
+ cbs[j]();
18
+ }
19
+ }
20
+ }
21
+ }
22
+ return {
23
+ then: function(cb) {
24
+ cb && (loaded ? cb() : (cbs.push(cb)));
25
+ }
26
+ };
27
+ };
28
+ })();
@@ -0,0 +1,39 @@
1
+ (function() {
2
+ window.isArray = function(val) {
3
+ return Object.prototype.toString.call(val) === '[object Array]';
4
+ };
5
+ window.isString = function(val) {
6
+ return typeof val === 'string';
7
+ };
8
+
9
+ window.hasEvent = function(event) {
10
+ return 'on'.concat(event) in window.document;
11
+ };
12
+
13
+ window.isOverallScroller = function(node) {
14
+ return node === document.documentElement || node === document.body || node === window;
15
+ };
16
+
17
+ window.isFormElement = function(node) {
18
+ var tagName = node.tagName;
19
+ return tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA';
20
+ };
21
+
22
+ window.pageLoad = (function () {
23
+ var loaded = false, cbs = [];
24
+ window.addEventListener('load', function () {
25
+ var i;
26
+ loaded = true;
27
+ if (cbs.length > 0) {
28
+ for (i = 0; i < cbs.length; i++) {
29
+ cbs[i]();
30
+ }
31
+ }
32
+ });
33
+ return {
34
+ then: function(cb) {
35
+ cb && (loaded ? cb() : (cbs.push(cb)));
36
+ }
37
+ };
38
+ })();
39
+ })();
@@ -0,0 +1,35 @@
1
+ {%- include snippets/get-sources.html -%}
2
+ {%- assign _sources = __return -%}
3
+
4
+ {%- include snippets/get-nav-url.html path="/assets/search.js" -%}
5
+ {%- assign _paths_search_js = __return -%}
6
+
7
+ <script>
8
+ (function() {
9
+ var TEXT_VARIABLES = {
10
+ version: '2.2.6',
11
+ sources: {
12
+ font_awesome: '{{ _sources.font_awesome }}',
13
+ jquery: '{{ _sources.jquery }}',
14
+ leancloud_js_sdk: '{{ _sources.leancloud_js_sdk }}',
15
+ chart: '{{ _sources.chart }}',
16
+ gitalk: {
17
+ js: '{{ _sources.gitalk.js }}',
18
+ css: '{{ _sources.gitalk.css }}'
19
+ },
20
+ valine: '{{ _sources.valine }}',
21
+ mathjax: '{{ _sources.mathjax }}',
22
+ mermaid: '{{ _sources.mermaid }}'
23
+ },
24
+ site: {
25
+ toc: {
26
+ selectors: '{{ site.toc.selectors | default: site.data.variables.default.toc.selectors }}'
27
+ }
28
+ },
29
+ paths: {
30
+ search_js: '{{ _paths_search_js }}'
31
+ }
32
+ };
33
+ window.TEXT_VARIABLES = TEXT_VARIABLES;
34
+ })();
35
+ </script>
@@ -0,0 +1,3 @@
1
+ <!-- start custom search snippet -->
2
+
3
+ <!-- end custom search snippet -->
@@ -0,0 +1,14 @@
1
+ window.TEXT_SEARCH_DATA={
2
+ {%- for _collection in site.collections -%}
3
+ {%- unless forloop.first -%},{%- endunless -%}
4
+ '{{ _collection.label }}':[
5
+ {%- for _article in _collection.docs -%}
6
+ {%- unless forloop.first -%},{%- endunless -%}
7
+ {'title':{{ _article.title | jsonify }},
8
+ {%- include snippets/prepend-baseurl.html path=_article.url -%}
9
+ {%- assign _url = __return -%}
10
+ 'url':{{ _url | jsonify }}}
11
+ {%- endfor -%}
12
+ ]
13
+ {%- endfor -%}
14
+ };
@@ -0,0 +1,18 @@
1
+ <div class="search search--dark">
2
+ <div class="main">
3
+ <div class="search__header">{{ _locale_search }}</div>
4
+ <div class="search-bar">
5
+ <div class="search-box js-search-box">
6
+ <div class="search-box__icon-search"><i class="fas fa-search"></i></div>
7
+ <input type="text" />
8
+ <div class="search-box__icon-clear js-icon-clear">
9
+ <a><i class="fas fa-times"></i></a>
10
+ </div>
11
+ </div>
12
+ <button class="button button--theme-dark button--pill search__cancel js-search-toggle">
13
+ {{ _locale_cancel }}</button>
14
+ </div>
15
+ <div class="search-result js-search-result"></div>
16
+ </div>
17
+ </div>
18
+ <script>{%- include search-providers/default/search.js -%}</script>
@@ -0,0 +1,112 @@
1
+ var SOURCES = window.TEXT_VARIABLES.sources;
2
+ var PAHTS = window.TEXT_VARIABLES.paths;
3
+ window.Lazyload.js([SOURCES.jquery, PAHTS.search_js], function() {
4
+ var search = (window.search || (window.search = {}));
5
+ var searchData = window.TEXT_SEARCH_DATA || {};
6
+
7
+ function memorize(f) {
8
+ var cache = {};
9
+ return function () {
10
+ var key = Array.prototype.join.call(arguments, ',');
11
+ if (key in cache) return cache[key];
12
+ else return cache[key] = f.apply(this, arguments);
13
+ };
14
+ }
15
+
16
+ /// search
17
+ function searchByQuery(query) {
18
+ var i, j, key, keys, cur, _title, result = {};
19
+ keys = Object.keys(searchData);
20
+ for (i = 0; i < keys.length; i++) {
21
+ key = keys[i];
22
+ for (j = 0; j < searchData[key].length; j++) {
23
+ cur = searchData[key][j], _title = cur.title;
24
+ if ((result[key] === undefined || result[key] && result[key].length < 4 )
25
+ && _title.toLowerCase().indexOf(query.toLowerCase()) >= 0) {
26
+ if (result[key] === undefined) {
27
+ result[key] = [];
28
+ }
29
+ result[key].push(cur);
30
+ }
31
+ }
32
+ }
33
+ return result;
34
+ }
35
+
36
+ var renderHeader = memorize(function(header) {
37
+ return $('<p class="search-result__header">' + header + '</p>');
38
+ });
39
+
40
+ var renderItem = function(index, title, url) {
41
+ return $('<li class="search-result__item" data-index="' + index + '"><a class="button" href="' + url + '">' + title + '</a></li>');
42
+ };
43
+
44
+ function render(data) {
45
+ if (!data) { return null; }
46
+ var $root = $('<ul></ul>'), i, j, key, keys, cur, itemIndex = 0;
47
+ keys = Object.keys(data);
48
+ for (i = 0; i < keys.length; i++) {
49
+ key = keys[i];
50
+ $root.append(renderHeader(key));
51
+ for (j = 0; j < data[key].length; j++) {
52
+ cur = data[key][j];
53
+ $root.append(renderItem(itemIndex++, cur.title, cur.url));
54
+ }
55
+ }
56
+ return $root;
57
+ }
58
+
59
+ // search box
60
+ var $result = $('.js-search-result'), $resultItems;
61
+ var lastActiveIndex, activeIndex;
62
+
63
+ function clear() {
64
+ $result.html(null);
65
+ $resultItems = $('.search-result__item'); activeIndex = 0;
66
+ }
67
+ function onInputNotEmpty(val) {
68
+ $result.html(render(searchByQuery(val)));
69
+ $resultItems = $('.search-result__item'); activeIndex = 0;
70
+ $resultItems.eq(0).addClass('active');
71
+ }
72
+
73
+ search.clear = clear;
74
+ search.onInputNotEmpty = onInputNotEmpty;
75
+
76
+ function updateResultItems() {
77
+ lastActiveIndex >= 0 && $resultItems.eq(lastActiveIndex).removeClass('active');
78
+ activeIndex >= 0 && $resultItems.eq(activeIndex).addClass('active');
79
+ }
80
+
81
+ function moveActiveIndex(direction) {
82
+ var itemsCount = $resultItems ? $resultItems.length : 0;
83
+ if (itemsCount > 1) {
84
+ lastActiveIndex = activeIndex;
85
+ if (direction === 'up') {
86
+ activeIndex = (activeIndex - 1 + itemsCount) % itemsCount;
87
+ } else if (direction === 'down') {
88
+ activeIndex = (activeIndex + 1 + itemsCount) % itemsCount;
89
+ }
90
+ updateResultItems();
91
+ }
92
+ }
93
+
94
+ // Char Code: 13 Enter, 37 ⬅, 38 ⬆, 39 ➡, 40 ⬇
95
+ $(window).on('keyup', function(e) {
96
+ var modalVisible = search.getModalVisible && search.getModalVisible();
97
+ if (modalVisible) {
98
+ if (e.which === 38) {
99
+ modalVisible && moveActiveIndex('up');
100
+ } else if (e.which === 40) {
101
+ modalVisible && moveActiveIndex('down');
102
+ } else if (e.which === 13) {
103
+ modalVisible && $resultItems && activeIndex >= 0 && $resultItems.eq(activeIndex).children('a')[0].click();
104
+ }
105
+ }
106
+ });
107
+
108
+ $result.on('mouseover', '.search-result__item > a', function() {
109
+ var itemIndex = $(this).parent().data('index');
110
+ itemIndex >= 0 && (lastActiveIndex = activeIndex, activeIndex = itemIndex, updateResultItems());
111
+ });
112
+ });
@@ -0,0 +1,21 @@
1
+ {%- if site.search.google.custom_search_engine_id -%}
2
+ <div class="search search--dark search--google-custom-search-engine">
3
+ <div class="main">
4
+ <div class="content js-gcse">
5
+ <!-- <gcse:search enableAutoComplete="true" gname="search-box"></gcse:search>
6
+ <gcse:searchresults-only gname="results"></gcse:searchresults-only> -->
7
+ </div>
8
+ </div>
9
+ </div>
10
+ <script>
11
+ var gcse = document.getElementsByClassName('js-gcse')[0];
12
+ var gcseSearch = document.createElement('gcse:search');
13
+ gcseSearch.setAttribute('enableAutoComplete', 'true');
14
+ gcseSearch.setAttribute('gname', 'search-box');
15
+ var gcseSearchresults = document.createElement('gcse:searchresults-only');
16
+ gcseSearchresults.setAttribute('gname', 'results');
17
+ gcse.appendChild(gcseSearch);
18
+ gcse.appendChild(gcseSearchresults);
19
+ </script>
20
+ <script>{%- include search-providers/google-custom-search-engine/search.js -%}</script>
21
+ {%- endif -%}
@@ -0,0 +1,33 @@
1
+ var SOURCES = window.TEXT_VARIABLES.sources;
2
+ window.Lazyload.js(SOURCES.jquery, function() {
3
+ /* global google */
4
+ var search = (window.search || (window.search = {}));
5
+ var searchBox, searchInput, clearIcon, searchModal;
6
+
7
+ search.clear = function() {
8
+ searchBox && searchBox.clearAllResults();
9
+ };
10
+ search.onShow = function() {
11
+ searchInput && searchInput.focus();
12
+ };
13
+ search.onHide = function() {
14
+ searchInput && searchInput.blur();
15
+ };
16
+
17
+ window.__gcse = {
18
+ callback: function() {
19
+ searchBox = google.search.cse.element.getElement('search-box');
20
+ searchInput = document.getElementById('gsc-i-id1');
21
+ clearIcon = document.getElementById('gs_cb50');
22
+ searchModal = search.searchModal;
23
+ searchModal && searchModal.$el && searchModal.$el.on('click', function(e) {
24
+ (e.target === this || e.target === clearIcon || e.target.className === 'gs-title') && searchModal.hide();
25
+ });
26
+ }
27
+ };
28
+ var cx = '{{ site.search.google.custom_search_engine_id }}'; // Insert your own Custom Search Engine ID here
29
+ var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
30
+ gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
31
+ '//cse.google.com/cse.js?cx=' + cx;
32
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
33
+ });
@@ -0,0 +1,20 @@
1
+ {%- include snippets/get-locale-string.html key='CANCEL' -%}
2
+ {%- assign _locale_cancel = __return -%}
3
+ {%- include snippets/get-locale-string.html key='SEARCH' -%}
4
+ {%- assign _locale_search = __return -%}
5
+
6
+ {%- if site.search.provider == 'google' -%}
7
+ <script>window.useDefaultSearchBox = false;</script>
8
+ {%- endif -%}
9
+
10
+ {%- if site.search.provider -%}
11
+ <script>{%- include scripts/components/search.js -%}</script>
12
+ {%- endif -%}
13
+
14
+ {%- if site.search.provider == 'default' -%}
15
+ {%- include search-providers/default/search.html -%}
16
+ {%- elsif site.search.provider == 'google' -%}
17
+ {%- include search-providers/google-custom-search-engine/search.html -%}
18
+ {%- elsif site.search.provider == 'custom' -%}
19
+ {%- include search-providers/custom/search.html -%}
20
+ {%- endif -%}
@@ -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 -->
@@ -0,0 +1,10 @@
1
+ <!-- AddToAny BEGIN -->
2
+ <div class="a2a_kit a2a_kit_size_32 a2a_default_style">
3
+ <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
4
+ <a class="a2a_button_facebook"></a>
5
+ <a class="a2a_button_twitter"></a>
6
+ <a class="a2a_button_google_plus"></a>
7
+ <a class="a2a_button_linkedin"></a>
8
+ </div>
9
+ <script async src="https://static.addtoany.com/menu/page.js"></script>
10
+ <!-- AddToAny END -->
@@ -0,0 +1,3 @@
1
+ <!-- start custom sharing snippet -->
2
+
3
+ <!-- end custom sharing snippet -->
@@ -0,0 +1,7 @@
1
+ {%- if site.sharing.provider == 'addtoany' -%}
2
+ {%- include sharing-providers/addtoany.html -%}
3
+ {%- elsif site.sharing.provider == 'addthis' -%}
4
+ {%- include sharing-providers/addthis.html -%}
5
+ {%- elsif site.sharing.provider == 'custom' -%}
6
+ {%- include sharing-providers/custom.html -%}
7
+ {%- endif -%}
@@ -0,0 +1,25 @@
1
+ {%- if page.sidebar.nav -%}
2
+ <div class="sidebar-toc">
3
+ {%- assign _sidebar_nav = site.data.navigation[page.sidebar.nav] -%}
4
+ {%- if _sidebar_nav -%}
5
+ <ul class="toc toc--navigator">
6
+ {%- for _item in _sidebar_nav -%}
7
+ <li class="toc-h1">{{ _item.title }}</li>
8
+ {%- if _item.children -%}
9
+ {%- for _child in _item.children -%}
10
+ {%- include snippets/get-nav-url.html path=_child.url -%}
11
+ {%- assign _nav_url = __return -%}
12
+ {%- include snippets/get-nav-url.html path=page.url -%}
13
+ {%- assign _page_url = __return -%}
14
+ {%- if _nav_url == _page_url -%}
15
+ <li class="toc-h2 active"><a href="{{ _nav_url }}">{{ _child.title }}</a></li>
16
+ {%- else -%}
17
+ <li class="toc-h2"><a href="{{ _nav_url }}">{{ _child.title }}</a></li>
18
+ {%- endif -%}
19
+ {%- endfor -%}
20
+ {%- endif -%}
21
+ {%- endfor -%}
22
+ </ul>
23
+ {%- endif -%}
24
+ </div>
25
+ {%- endif -%}
@@ -0,0 +1,9 @@
1
+ {%- if include.source1 == nil -%}
2
+ {%- if include.source0 == nil -%}
3
+ {%- assign __return = include.target -%}
4
+ {%- else -%}
5
+ {%- assign __return = include.source0 -%}
6
+ {%- endif -%}
7
+ {%- else -%}
8
+ {%- assign __return = include.source1 -%}
9
+ {%- endif -%}
@@ -0,0 +1,11 @@
1
+ {%- assign _title = include.article.title | default: layout.title -%}
2
+ {%- assign _titles = include.article.titles | default: layout.titles -%}
3
+
4
+ {%- if _title -%}
5
+ {%- assign __return = _title -%}
6
+ {%- elsif _titles -%}
7
+ {%- include snippets/get-string-from-locale-config.html locale=_titles -%}
8
+ {%- assign __return = __return -%}
9
+ {%- else -%}
10
+ {%- assign __return = nil -%}
11
+ {%- endif -%}
@@ -0,0 +1,6 @@
1
+ {%- assign __return = site.data.variables.default.lang -%}
2
+ {%- if page.lang -%}
3
+ {%- assign __return = page.lang -%}
4
+ {%- elsif site.lang -%}
5
+ {%- assign __return = site.lang -%}
6
+ {%- endif -%}
@@ -0,0 +1,12 @@
1
+ {%- include snippets/get-lang.html -%}
2
+ {%- assign _lang = __return -%}
3
+ {%- assign _local_lang = site.data.locale[_lang] -%}
4
+ {%- assign _local_lang_en = site.data.locale.en -%}
5
+ {%- if _local_lang == nil -%}
6
+ {%- assign _local_lang = _local_lang_en -%}
7
+ {%- endif -%}
8
+ {%- if _local_lang[include.key] -%}
9
+ {%- assign __return = _local_lang[include.key] -%}
10
+ {%- else -%}
11
+ {%- assign __return = _local_lang_en[include.key] -%}
12
+ {%- endif -%}
@@ -0,0 +1,8 @@
1
+ {%- assign _pre7 = include.path | slice: 0, 7 -%}
2
+ {%- assign _pre8 = include.path | slice: 0, 8 -%}
3
+ {%- if _pre7 == 'http://' or _pre8 == 'https://' -%}
4
+ {%- assign __return = include.path -%}
5
+ {%- else -%}
6
+ {%- include snippets/prepend-baseurl.html path=include.path -%}
7
+ {%- assign __return = __return -%}
8
+ {%- endif -%}
@@ -0,0 +1,2 @@
1
+ {%- assign _sources = site.sources | default: site.data.variables.default.sources -%}
2
+ {%- assign __return = site.data.variables.sources[_sources] -%}
@@ -0,0 +1,7 @@
1
+ {%- include snippets/get-lang.html -%}
2
+ {%- assign _lang = __return -%}
3
+ {%- if include.locale[_lang] -%}
4
+ {%- assign __return = include.locale[_lang] -%}
5
+ {%- else -%}
6
+ {%- assign __return = include.locale.en -%}
7
+ {%- endif -%}
@@ -0,0 +1,6 @@
1
+ {%- assign _page_path_first_char = include.page.path | slice: 0, 1 -%}
2
+ {%- if _page_path_first_char == '_' -%}
3
+ {%- assign __return = true -%}
4
+ {%- else -%}
5
+ {%- assign __return = false -%}
6
+ {%- endif -%}
@@ -0,0 +1,2 @@
1
+ {%- include snippets/prepend-baseurl.html path=page.url -%}
2
+ {{ __return | prepend: site.url }}
@@ -0,0 +1,4 @@
1
+ {%- assign _include_path_replace_index = include.path | replace: 'index.html', '' -%}
2
+ {%- include snippets/prepend-path.html
3
+ path=_include_path_replace_index
4
+ prepend_path=site.baseurl -%}
@@ -0,0 +1 @@
1
+ {%- assign __return = include.path | prepend: '/' | prepend: include.prepend_path | replace:'///','/' | replace:'//','/' -%}
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M1056.000001 193.714286l-292 0 0 70.857143 292 0 0-70.857143zm-144 243.428571q-51.428571 0-83.428571 30t-35.428571 81.428571l233.142857 0q-10.285714-111.428571-114.285714-111.428571zm9.142857 334.285714q36 0 69.714286-18.285714t43.428571-49.714286l126.285714 0q-57.142857 175.428571-244 175.428571-122.285714 0-194.571429-75.428571t-72.285714-198.285714q0-118.857143 74.571429-197.428571t192.285714-78.571429q78.857143 0 137.428571 38.857143t87.428571 102.285714 28.857143 141.714286q0 9.714286-1.142857 26.857143l-376 0q0 63.428571 32.857143 98t95.142857 34.571429zm-762.857143-28.571429l169.142857 0q117.142857 0 117.142857-95.428571 0-102.857143-113.714286-102.857143l-172.571429 0 0 198.285714zm0-306.857143l160.571429 0q44.571429 0 70.571429-20.857143t26-64.857143q0-82.285714-108.571429-82.285714l-148.571429 0 0 168zm-158.285714-290.857143l339.428571 0q49.714286 0 88.571429 8t72.285714 27.142857 51.428571 55.142857 18 88q0 103.428571-98.285714 150.285714 65.142857 18.285714 98.285714 65.714286t33.142857 116.571429q0 42.857143-14 78t-37.714286 59.142857-56.285714 40.571429-69.142857 24-76.571429 7.428571l-349.142857 0 0-720z" />
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M161.431 147.172l699.701 0 0 78.813-699.701 0 0-78.814z" />
3
+ <path d="M800.298 616.311l0-308.108-578.031 0 0 308.108 578.031 0zM306.076 386.961l411.23 0 0 150.633-411.23 0 0-150.633z" />
4
+ <path d="M675.281 793.89c25.15-38.487 48.885-83.129 70.879-133.81l-84.107-30.649c-21.885 60.046-47.337 114.974-76.324 164.459l-146.332 0c-24.225-64.156-51.607-119.031-82.313-164.459l-77.357 30.649c31.9 47.851 57.651 92.383 77.357 133.81l-215.414 0 0 77.957 739.278 0 0-77.957-205.67 0z" />
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M767.428571 6.857143l0 150.857143-89.714286 0q-49.142857 0-66.285714 20.571429t-17.142857 61.714286l0 108 167.428571 0-22.285714 169.142857-145.142857 0 0 433.714286-174.857143 0 0-433.714286-145.714286 0 0-169.142857 145.714286 0 0-124.571429q0-106.285714 59.428571-164.857143t158.285714-58.571429q84 0 130.285714 6.857143z" />
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M512 996.693333C245.76 996.693333 27.306667 778.24 27.306667 512 27.306667 245.76 245.76 27.306667 512 27.306667c266.24 0 484.693333 218.453333 484.693333 484.693333C996.693333 778.24 778.24 996.693333 512 996.693333zM512 78.506667C273.066667 78.506667 78.506667 273.066667 78.506667 512S273.066667 945.493333 512 945.493333 945.493333 750.933333 945.493333 512 750.933333 78.506667 512 78.506667z" />
3
+ <path d="M655.36 512m-129.706667 0a3.8 3.8 0 1 0 259.413333 0 3.8 3.8 0 1 0-259.413333 0Z" />
4
+ <path d="M368.64 512m-129.706667 0a3.8 3.8 0 1 0 259.413333 0 3.8 3.8 0 1 0-259.413333 0Z" />
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path class="svgpath" data-index="path_0" fill="#272636" d="M0 525.2c0 223.6 143.3 413.7 343 483.5 26.9 6.8 22.8-12.4 22.8-25.4l0-88.7c-155.3 18.2-161.5-84.6-172-101.7-21.1-36-70.8-45.2-56-62.3 35.4-18.2 71.4 4.6 113.1 66.3 30.2 44.7 89.1 37.2 119 29.7 6.5-26.9 20.5-50.9 39.7-69.6C248.8 728.2 181.7 630 181.7 513.2c0-56.6 18.7-108.7 55.3-150.7-23.3-69.3 2.2-128.5 5.6-137.3 66.5-6 135.5 47.6 140.9 51.8 37.8-10.2 80.9-15.6 129.1-15.6 48.5 0 91.8 5.6 129.8 15.9 12.9-9.8 77-55.8 138.8-50.2 3.3 8.8 28.2 66.7 6.3 135 37.1 42.1 56 94.6 56 151.4 0 117-67.5 215.3-228.8 243.7 26.9 26.6 43.6 63.4 43.6 104.2l0 128.8c0.9 10.3 0 20.5 17.2 20.5C878.1 942.4 1024 750.9 1024 525.3c0-282.9-229.3-512-512-512C229.1 13.2 0 242.3 0 525.2L0 525.2z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M621.31315 72.459289l-228.995461 0c-60.030212 0-135.601374 8.695033-198.98189 59.797921-47.839565 40.21184-71.180156 95.678106-71.180156 145.682987 0 84.786035 66.730821 170.671101 184.5369 170.671101 11.150968 0 23.341614-1.098008 35.619242-2.167363-5.574972 13.028735-11.122315 23.89113-11.122315 42.407855 0 33.68417 17.73799 54.338582 33.308617 73.894987-50.004881 3.264347-143.401014 8.695033-212.32785 50.005904-65.60416 38.046524-85.59547 93.483114-85.59547 132.624577 0 80.453357 77.794807 155.476027 239.019769 155.476027 191.20988 0 292.377-103.274108 292.377-205.451232 0-75.021647-44.402279-111.99984-93.367481-152.21168l-40.037878-30.447453c-12.219299-9.764388-28.887934-22.821775-28.887934-46.741557 0-23.890107 16.668635-39.142485 31.141254-53.269227 46.654576-35.879162 93.366458-73.925686 93.366458-154.37802 0-82.619696-53.357232-126.096906-78.951143-146.751319l68.926836 0L621.31315 72.459289zM523.497357 737.809909c0 67.367317-56.678884 117.373221-163.419953 117.373221-118.961392 0-195.687868-55.43659-195.687868-132.626623 0-77.18901 71.180156-103.274108 95.619778-111.969141 46.683229-15.223726 106.74107-17.419741 116.765377-17.419741 11.092639 0 16.638959 0 25.536606 1.098008C486.838436 652.994198 523.497357 682.316014 523.497357 737.809909zM434.608887 387.745045c-17.822924 17.36039-47.895847 30.447453-75.658144 30.447453-95.591125 0-138.980331-120.694873-138.980331-193.521528 0-28.281113 5.547343-57.631582 24.496927-80.453357 17.795295-21.75242 48.879244-35.879162 77.794807-35.879162 92.298126 0 140.078339 121.763205 140.078339 200.021569C462.341508 327.916425 460.116841 362.727255 434.608887 387.745045zM842.798567 238.016929 842.798567 127.57763l-55.464219 0 0 110.439298L676.402839 238.016929l0 55.234999 110.930485 0 0 110.438275 55.464219 0L842.797543 293.251927l110.929462 0 0-55.234999L842.798567 238.016929z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M260.096 155.648c0 27.307008-9.899008 50.516992-29.696 69.632-19.796992 19.115008-45.396992 28.672-76.8 28.672-30.036992 0-54.612992-9.556992-73.728-28.672-19.115008-19.115008-28.672-42.324992-28.672-69.632 0-28.672 9.556992-52.224 28.672-70.656 19.115008-18.432 44.372992-27.648 75.776-27.648 31.403008 0 56.32 9.216 74.752 27.648 18.432 18.432 28.331008 41.984 29.696 70.656 0 0 0 0 0 0m-202.752 808.96c0 0 0-632.832 0-632.832 0 0 196.608 0 196.608 0 0 0 0 632.832 0 632.832 0 0-196.608 0-196.608 0 0 0 0 0 0 0m313.344-430.08c0-58.708992-1.364992-126.292992-4.096-202.752 0 0 169.984 0 169.984 0 0 0 10.24 88.064 10.24 88.064 0 0 4.096 0 4.096 0 40.96-68.267008 105.812992-102.4 194.56-102.4 68.267008 0 123.220992 22.868992 164.864 68.608 41.643008 45.739008 62.464 113.664 62.464 203.776 0 0 0 374.784 0 374.784 0 0-196.608 0-196.608 0 0 0 0-350.208 0-350.208 0-91.476992-33.451008-137.216-100.352-137.216-47.787008 0-81.236992 24.576-100.352 73.728-4.096 8.192-6.144 24.576-6.144 49.152 0 0 0 364.544 0 364.544 0 0-198.656 0-198.656 0 0 0 0-430.08 0-430.08 0 0 0 0 0 0" />
3
+ </svg>