jekyll-text-theme-fork 2.2.6

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 (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,39 @@
1
+ {%- if page.key and
2
+ site.comments.gitalk.clientID and
3
+ site.comments.gitalk.clientSecret and
4
+ site.comments.gitalk.repository and
5
+ site.comments.gitalk.owner and
6
+ site.comments.gitalk.admin -%}
7
+
8
+ <!-- fix text color in the input textarea of gitalk -->
9
+ <style type="text/css">
10
+ .gitalk-wrapper .gt-header-textarea {
11
+ color: #333 !important;
12
+ }
13
+ </style>
14
+
15
+ {%- include snippets/get-sources.html -%}
16
+ {%- assign _sources = __return -%}
17
+ <div class="gitalk-wrapper" id="js-gitalk-container"></div>
18
+ {%- assign _admin = '' -%}
19
+ {%- for _admin_id in site.comments.gitalk.admin -%}
20
+ {%- assign _admin = _admin | append: ", '" | append: _admin_id | append: "'" -%}
21
+ {%- endfor -%}
22
+ {%- assign _last = _admin | size | minus: 1 -%}
23
+ {%- assign _admin = _admin | slice: 2, _last -%}
24
+ <script>
25
+ window.Lazyload.css('{{ _sources.gitalk.css }}');
26
+ window.Lazyload.js('{{ _sources.gitalk.js }}', function() {
27
+ var gitalk = new Gitalk({
28
+ clientID: '{{ site.comments.gitalk.clientID }}',
29
+ clientSecret: '{{ site.comments.gitalk.clientSecret }}',
30
+ repo: '{{ site.comments.gitalk.repository }}',
31
+ owner: '{{ site.comments.gitalk.owner }}',
32
+ admin: [{{ _admin }}],
33
+ id: '{{ page.key }}'
34
+ });
35
+ gitalk.render('js-gitalk-container');
36
+ });
37
+ </script>
38
+
39
+ {%- endif -%}
@@ -0,0 +1,46 @@
1
+ {%- include snippets/get-sources.html -%}
2
+ {%- assign _sources = __return -%}
3
+
4
+ {%- assign _VALINE_APP_ID = site.comments.valine.app_id -%}
5
+ {%- assign _VALINE_APP_KEY = site.comments.valine.app_key -%}
6
+ {%- assign _VALINE_PLACEHOLDER = site.comments.valine.placeholder -%}
7
+ {%- assign _VALINE_VISITOR = site.comments.valine.visitor -%}
8
+ {%- assign _VALINE_META = site.comments.valine.meta -%}
9
+
10
+
11
+ {%- if _VALINE_APP_ID and
12
+ _VALINE_APP_KEY -%}
13
+
14
+ <div id="vcomments"></div>
15
+
16
+ {%- if _VALINE_VISITOR -%}
17
+ <span id="{{page.url}}" class="leancloud-visitors" data-flag-title={{page.title}}>
18
+ </span>
19
+ {%- endif -%}
20
+
21
+ <script>
22
+ window.Lazyload.js(['{{ _sources.leancloud_js_sdk}}', '{{ _sources.valine }}'], function() {
23
+ var _config = {
24
+ el: '#vcomments',
25
+ appId: '{{ _VALINE_APP_ID }}',
26
+ appKey: '{{ _VALINE_APP_KEY }}',
27
+ verify: true,
28
+ };
29
+ {%- if _VALINE_PLACEHOLDER -%}
30
+ _config.placeholder = '{{ _VALINE_PLACEHOLDER }}';
31
+ {%- endif -%}
32
+ {%- assign _page_lang_slice = page.lang | slice: 0, 2 -%}
33
+ {%- if _page_lang_slice != 'zh' -%}
34
+ _config.lang = 'en';
35
+ {%- endif -%}
36
+ {%- if _VALINE_VISITOR -%}
37
+ _config.visitor = 'true';
38
+ {%- endif -%}
39
+ {%- if _VALINE_META -%}
40
+ _config.meta = {{ _VALINE_META}};
41
+ {%- endif -%}
42
+ new Valine(_config);
43
+ });
44
+ </script>
45
+
46
+ {%- endif -%}
@@ -0,0 +1,11 @@
1
+ {%- if jekyll.environment != 'development' -%}
2
+ {%- if site.comments.provider == 'disqus' -%}
3
+ {%- include comments-providers/disqus.html -%}
4
+ {%- elsif site.comments.provider == 'gitalk' -%}
5
+ {%- include comments-providers/gitalk.html -%}
6
+ {%- elsif site.comments.provider == 'valine' -%}
7
+ {%- include comments-providers/valine.html -%}
8
+ {%- elsif site.comments.provider == 'custom' -%}
9
+ {%- include comments-providers/custom.html -%}
10
+ {%- endif -%}
11
+ {%- endif -%}
@@ -0,0 +1,5 @@
1
+ <div class="extensions extensions--video">
2
+ <iframe src="//player.bilibili.com/player.html?aid={{ include.id }}&page=1"
3
+ frameborder="no" scrolling="no" allowfullscreen="true">
4
+ </iframe>
5
+ </div>
@@ -0,0 +1,4 @@
1
+ <div class="extensions extensions--demo">
2
+ <iframe src='//codepen.io/{{ include.user }}/embed/{{ include.hash }}/?theme-id=0&default-tab={{ include.default_tab | default: result }}'
3
+ frameborder="0" scrolling="no" allowfullscreen></iframe>
4
+ </div>
@@ -0,0 +1,4 @@
1
+ <iframe class="extensions extensions--audio" width="330" height="86"
2
+ src="//music.163.com/outchain/player?type=2&id={{ include.id }}&auto=1&height=66"
3
+ frameborder="no" border="0" marginwidth="0" marginheight="0">
4
+ </iframe>
@@ -0,0 +1,6 @@
1
+ <div class="extensions extensions--slide">
2
+ <iframe src="//www.slideshare.net/slideshow/embed_code/key/{{ include.id }}"
3
+ width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"
4
+ style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen>
5
+ </iframe>
6
+ </div>
@@ -0,0 +1,4 @@
1
+ <iframe class="extensions extensions--audio" width="100%" height="166"
2
+ src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{{ include.id }}&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true"
3
+ scrolling="no" frameborder="no" allow="autoplay">
4
+ </iframe>
@@ -0,0 +1,5 @@
1
+ <div class="extensions extensions--video">
2
+ <iframe src="https://embed.ted.com/talks/{{ include.id }}"
3
+ frameborder="0" scrolling="no" allowfullscreen>
4
+ </iframe>
5
+ </div>
@@ -0,0 +1,4 @@
1
+ <div class="extensions extensions--video">
2
+ <iframe src="https://www.youtube.com/embed/{{ include.id }}?rel=0&showinfo=0"
3
+ frameborder="0" scrolling="no" allowfullscreen></iframe>
4
+ </div>
@@ -0,0 +1,37 @@
1
+
2
+ <footer class="footer py-4 js-page-footer">
3
+ <div class="main">
4
+
5
+ {%- assign _site_author = site.author -%}
6
+ {%- if _site_author.type == 'organization' -%}
7
+ {%- assign _site_author_itemtype = 'http://schema.org/Organization' -%}
8
+ {%- else -%}
9
+ {%- assign _site_author_itemtype = 'http://schema.org/Person' -%}
10
+ {%- endif -%}
11
+
12
+ <div itemscope itemtype="{{ _site_author_itemtype }}">
13
+ <meta itemprop="name" content="{{ _site_author.name }}">
14
+ {%- assign _site_author_url = _site_author.url | default: '/'-%}
15
+ {%- include snippets/get-nav-url.html path=_site_author_url -%}
16
+ {%- assign _site_author_url = __return -%}
17
+ <meta itemprop="url" content="{{ _site_author_url }}">
18
+ {%- if _site_author.bio -%}
19
+ <meta itemprop="description" content="{{ _site_author.bio }}">
20
+ {%- endif -%}
21
+ <div class="footer__author-links">
22
+ {%- include author-links.html author=_site_author -%}
23
+ </div>
24
+ </div>
25
+ {%- include snippets/get-locale-string.html key='COPYRIGHT_DATES' -%}
26
+ {%- assign _locale_copyright_dates = __return -%}
27
+ <div class="site-info mt-2">
28
+ <div>
29
+ {%- include snippets/get-locale-string.html key='COPYRIGHT_DATES' -%}
30
+ {%- assign _locale_copyright_dates = __return -%}
31
+ © {{ site.title }} {{ _locale_copyright_dates }},
32
+ Powered by <a title="Jekyll is a simple, blog-aware, static site generator." href="http://jekyllrb.com/">Jekyll</a> & <a
33
+ title="TeXt is a super customizable Jekyll theme." href="https://github.com/kitian616/jekyll-TeXt-theme">TeXt Theme</a>.
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </footer>
@@ -0,0 +1,3 @@
1
+ <!-- start custom head snippets -->
2
+
3
+ <!-- end custom head snippets -->
@@ -0,0 +1,26 @@
1
+ <!-- start favicons snippet, use https://realfavicongenerator.net/ -->
2
+ {%- include snippets/prepend-baseurl.html path='/assets/apple-touch-icon.png' -%}
3
+ <link rel="apple-touch-icon" sizes="180x180" href="{{ __return }}">
4
+
5
+ {%- include snippets/prepend-baseurl.html path='/assets/favicon-32x32.png' -%}
6
+ <link rel="icon" type="image/png" sizes="32x32" href="{{ __return }}">
7
+
8
+ {%- include snippets/prepend-baseurl.html path='/assets/favicon-16x16.png' -%}
9
+ <link rel="icon" type="image/png" sizes="16x16" href="{{ __return }}">
10
+
11
+ {%- include snippets/prepend-baseurl.html path='/assets/site.webmanifest' -%}
12
+ <link rel="manifest" href="{{ __return }}">
13
+
14
+ {%- include snippets/prepend-baseurl.html path='/assets/safari-pinned-tab.svg' -%}
15
+ <link rel="mask-icon" href="{{ __return }}" color="#fc4d50">
16
+
17
+ {%- include snippets/prepend-baseurl.html path='/assets/favicon.ico' -%}
18
+ <link rel="shortcut icon" href="{{ __return }}">
19
+
20
+ <meta name="msapplication-TileColor" content="#ffc40d">
21
+
22
+ {%- include snippets/prepend-baseurl.html path='/assets/browserconfig.xml' -%}
23
+ <meta name="msapplication-config" content="{{ __return }}">
24
+
25
+ <meta name="theme-color" content="#ffffff">
26
+ <!-- end favicons snippet -->
@@ -0,0 +1,24 @@
1
+ <meta charset="utf-8">
2
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
3
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
4
+
5
+ {%- include snippets/get-article-title.html article=page -%}
6
+ <title>{%- if __return -%}{{ __return }} - {{ site.title }}{%- else -%}{{ site.title }}{%- endif -%}</title>
7
+
8
+ <meta name="description" content="{%- if page.excerpt -%}{{ page.excerpt | strip_html | strip_newlines | strip | truncate: 160 }}{%- else -%}{{ site.description }}{%- endif -%}">
9
+ <link rel="canonical" href="{%- include snippets/page-url.html -%}">
10
+
11
+ {%- assign _paths_rss = site.paths.rss | default: site.data.variables.default.paths.rss -%}
12
+ {%- include snippets/get-nav-url.html path=_paths_rss -%}
13
+ <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ __return }}">
14
+
15
+ {%- include head/favicon.html -%}
16
+
17
+ {%- include snippets/prepend-baseurl.html path='/assets/css/main.css' -%}
18
+ <link rel="stylesheet" href="{{ __return }}">
19
+
20
+ {%- include snippets/get-sources.html -%}
21
+ {%- assign _sources = __return -%}
22
+ <link rel="stylesheet" href="{{ _sources.font_awesome }}" >
23
+
24
+ {%- include head/custom.html -%}
@@ -0,0 +1,44 @@
1
+ {%- if include.theme == 'dark' -%}
2
+ <header class="header header--dark" {%- if include.background -%} style="background: {{ include.background }};" {%- endif -%}>
3
+ {%- elsif include.theme == 'light' -%}
4
+ <header class="header header--light" {%- if include.background -%} style="background: {{ include.background }};" {%- endif -%}>
5
+ {%- else -%}
6
+ <header class="header" {%- if include.background -%} style="background: {{ include.background }};" {%- endif -%}>
7
+ {%- endif -%}
8
+ <div class="main">
9
+ <div class="header__title">
10
+ <div class="header__brand">
11
+ {%- include svg/logo.svg -%}
12
+ {%- assign _paths_root = site.paths.root | default: site.data.variables.default.paths.root -%}
13
+ {%- include snippets/get-nav-url.html path=_paths_root -%}
14
+ {%- if site.title -%}
15
+ <a title="{%- if site.description -%}{{ site.description }}{%- endif -%}" href="{{ __return }}">{{ site.title }}</a>
16
+ {%- endif -%}
17
+ </div>
18
+ {%- if site.search.provider -%}
19
+ <button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button>
20
+ {%- endif -%}
21
+ </div>
22
+ {%- if site.data.navigation.header -%}
23
+ <nav class="navigation">
24
+ <ul>
25
+ {%- for _item in site.data.navigation.header -%}
26
+ {%- include snippets/get-nav-url.html path=_item.url -%}
27
+ {%- assign _nav_url = __return -%}
28
+ {%- include snippets/get-nav-url.html path=page.url -%}
29
+ {%- assign _page_url = __return -%}
30
+ {%- include snippets/get-string-from-locale-config.html locale=_item.titles -%}
31
+ {%- if _nav_url == _page_url or page.nav_key and _item.key and page.nav_key == _item.key -%}
32
+ <li class="navigation__item navigation__item--active"><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li>
33
+ {%- else -%}
34
+ <li class="navigation__item"><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li>
35
+ {%- endif -%}
36
+ {%- endfor -%}
37
+ {%- if site.search.provider -%}
38
+ <li><button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button></li>
39
+ {%- endif -%}
40
+ </ul>
41
+ </nav>
42
+ {%- endif -%}
43
+ </div>
44
+ </header>
@@ -0,0 +1,3 @@
1
+ <!-- start custom main bottom snippet -->
2
+
3
+ <!-- end custom main bottom snippet -->
@@ -0,0 +1,3 @@
1
+ <!-- start custom main top snippet -->
2
+
3
+ <!-- end custom main top snippet -->
@@ -0,0 +1,15 @@
1
+ {%- include snippets/get-sources.html -%}
2
+ {%- assign _sources = __return -%}
3
+ <script>
4
+ window.Lazyload.js(['{{ _sources.jquery }}', '{{ _sources.chart }}'], function() {
5
+ var $canvas = null, $this = null, _ctx = null, _text = '';
6
+ $('.language-chart').each(function(){
7
+ $this = $(this);
8
+ $canvas = $('<canvas></canvas>');
9
+ _text = $this.text();
10
+ $this.text('').append($canvas);
11
+ _ctx = $canvas.get(0).getContext('2d');
12
+ (_ctx && _text) && (new Chart(_ctx, JSON.parse(_text)) && $this.attr('data-processed', true));
13
+ });
14
+ });
15
+ </script>
@@ -0,0 +1,17 @@
1
+ {%- include snippets/get-sources.html -%}
2
+ {%- assign _sources = __return -%}
3
+
4
+ {%- include snippets/assign.html target=site.data.variables.default.mathjax_autoNumber
5
+ source0=site.mathjax_autoNumber source1=page.mathjax_autoNumber -%}
6
+ {%- assign _mathjax_autoNumber = __return -%}
7
+
8
+ <script type="text/x-mathjax-config">
9
+ var _config = { tex2jax: {
10
+ inlineMath: [['$','$'], ['\\(','\\)']]
11
+ }};
12
+ {%- if _mathjax_autoNumber == true -%}
13
+ _config.TeX = { equationNumbers: { autoNumber: "all" } };
14
+ {%- endif -%}
15
+ MathJax.Hub.Config(_config);
16
+ </script>
17
+ <script type="text/javascript" src="{{ _sources.mathjax }}" async></script>
@@ -0,0 +1,10 @@
1
+ {%- include snippets/get-sources.html -%}
2
+ {%- assign _sources = __return -%}
3
+ <script>
4
+ window.Lazyload.js('{{ _sources.mermaid }}', function() {
5
+ mermaid.initialize({
6
+ startOnLoad: true
7
+ });
8
+ mermaid.init(undefined, '.language-mermaid');
9
+ });
10
+ </script>
@@ -0,0 +1,17 @@
1
+ {%- include snippets/assign.html target=site.data.variables.default.chart
2
+ source0=site.chart source1=page.chart -%}
3
+ {%- if __return == true -%}
4
+ {%- include markdown-enhancements/chart.html -%}
5
+ {%- endif -%}
6
+
7
+ {%- include snippets/assign.html target=site.data.variables.default.mathjax
8
+ source0=site.mathjax source1=page.mathjax -%}
9
+ {%- if __return == true -%}
10
+ {%- include markdown-enhancements/mathjax.html -%}
11
+ {%- endif -%}
12
+
13
+ {%- include snippets/assign.html target=site.data.variables.default.mermaid
14
+ source0=site.mermaid source1=page.mermaid -%}
15
+ {%- if __return == true -%}
16
+ {%- include markdown-enhancements/mermaid.html -%}
17
+ {%- endif -%}
@@ -0,0 +1,3 @@
1
+ <!-- start custom pageview snippet (for Home layout) -->
2
+
3
+ <!-- end custom pageview snippet (for Home layout) -->
@@ -0,0 +1,3 @@
1
+ <!-- start custom pageview snippet (for the post) -->
2
+
3
+ <!-- end custom pageview snippet (for the post) -->
@@ -0,0 +1,35 @@
1
+ {%- include snippets/get-sources.html -%}
2
+ {%- assign _sources = __return -%}
3
+
4
+ {%- assign _LEANCLOUD_APP_ID = site.pageview.leancloud.app_id -%}
5
+ {%- assign _LEANCLOUD_APP_KEY = site.pageview.leancloud.app_key -%}
6
+ {%- assign _LEANCLOUD_APP_CLASS = site.pageview.leancloud.app_class -%}
7
+
8
+ {%- if _LEANCLOUD_APP_ID and
9
+ _LEANCLOUD_APP_KEY and
10
+ _LEANCLOUD_APP_CLASS -%}
11
+
12
+ <script>
13
+ {%- include pageview-providers/leancloud/leancloud.js -%}
14
+ </script>
15
+ <script>
16
+ window.Lazyload.js(['{{ _sources.jquery }}', '{{ _sources.leancloud_js_sdk}}'], function() {
17
+ var pageview = window.pageview(AV, {
18
+ appId: '{{ _LEANCLOUD_APP_ID }}',
19
+ appKey: '{{ _LEANCLOUD_APP_KEY }}',
20
+ appClass: '{{ _LEANCLOUD_APP_CLASS }}'
21
+ });
22
+ $('.js-pageview').each(function() {
23
+ var $this = $(this);
24
+ var key = $this.attr('data-page-key');
25
+ pageview.get(key, function(view) {
26
+ $this.attr('itemprop', 'userInteractionCount').attr('content', view).text(view);
27
+ });
28
+ });
29
+ });
30
+ </script>
31
+
32
+ {%- endif -%}
33
+
34
+
35
+
@@ -0,0 +1,72 @@
1
+ (function() {
2
+ function errorHandler(error, callback) {
3
+ if (error) {
4
+ callback && callback(error);
5
+ throw error;
6
+ }
7
+ }
8
+
9
+ function pageview(_AV, options) {
10
+ var AV = _AV;
11
+ var appId, appKey, appClass;
12
+ appId = options.appId;
13
+ appKey = options.appKey;
14
+ appClass = options.appClass;
15
+ AV.init({
16
+ serverURLs: 'https://avoscloud.com',
17
+ appId: appId,
18
+ appKey: appKey
19
+ });
20
+ return {
21
+ get: get,
22
+ increase: increase
23
+ };
24
+
25
+ function searchKey(key) {
26
+ var query = new AV.Query(appClass);
27
+ query.equalTo('key', key);
28
+ return query.first();
29
+ }
30
+
31
+ function insert(key, title) {
32
+ var Blog = AV.Object.extend(appClass);
33
+ var blog = new Blog();
34
+ blog.set('title', title);
35
+ blog.set('key', key);
36
+ blog.set('views', 0);
37
+ return blog.save();
38
+ }
39
+
40
+ function increment(result) {
41
+ result.increment('views', 1);
42
+ return result.save(null, {
43
+ fetchWhenSave: true
44
+ });
45
+ }
46
+
47
+ function get(key, callback) {
48
+ searchKey(key).then(function(result) {
49
+ if (result) {
50
+ callback && callback(result.attributes.views);
51
+ }
52
+ }, errorHandler);
53
+ }
54
+
55
+ function increase(key, title, callback) {
56
+ searchKey(key).then(function(result) {
57
+ if (result) {
58
+ increment(result).then(function(result) {
59
+ callback && callback(result.attributes.views);
60
+ });
61
+ } else {
62
+ insert(key, title).then(function(result) {
63
+ increment(result).then(function(result) {
64
+ callback && callback(result.attributes.views);
65
+ });
66
+ }, errorHandler);
67
+ }
68
+ }, errorHandler);
69
+ }
70
+ }
71
+ window.pageview = pageview;
72
+ })();
@@ -0,0 +1,31 @@
1
+ {%- include snippets/get-sources.html -%}
2
+ {%- assign _sources = __return -%}
3
+
4
+ {%- assign _LEANCLOUD_APP_ID = site.pageview.leancloud.app_id -%}
5
+ {%- assign _LEANCLOUD_APP_KEY = site.pageview.leancloud.app_key -%}
6
+ {%- assign _LEANCLOUD_APP_CLASS = site.pageview.leancloud.app_class -%}
7
+
8
+ {%- if page.key and
9
+ _LEANCLOUD_APP_ID and
10
+ _LEANCLOUD_APP_KEY and
11
+ _LEANCLOUD_APP_CLASS -%}
12
+
13
+ <script>
14
+ {%- include pageview-providers/leancloud/leancloud.js -%}
15
+ </script>
16
+ <script>
17
+ window.Lazyload.js(['{{ _sources.jquery }}', '{{ _sources.leancloud_js_sdk}}'], function() {
18
+ var pageview = window.pageview(AV, {
19
+ appId: '{{ _LEANCLOUD_APP_ID }}',
20
+ appKey: '{{ _LEANCLOUD_APP_KEY }}',
21
+ appClass: '{{ _LEANCLOUD_APP_CLASS }}'
22
+ });
23
+ var key = '{{ page.key }}';
24
+ var title = {{ page.title | jsonify }};
25
+ pageview.increase(key, title, function(view) {
26
+ $("[data-page-key='{{ page.key }}']").text(view);
27
+ });
28
+ });
29
+ </script>
30
+
31
+ {%- endif -%}
@@ -0,0 +1,29 @@
1
+ {%- include snippets/assign.html target=site.data.variables.default.pageview source0=page.pageview -%}
2
+ {%- assign _pageview = __return -%}
3
+
4
+
5
+ {%- if page.layout == "home" -%}
6
+
7
+ {%- if jekyll.environment != "development" -%}
8
+ {%- if site.pageview.provider == 'leancloud' -%}
9
+ {%- include pageview-providers/leancloud/home.html -%}
10
+ {%- elsif site.pageview.provider == 'custom' -%}
11
+ {%- include pageview-providers/custom/home.html -%}
12
+ {%- endif -%}
13
+ {%- endif -%}
14
+
15
+
16
+ {%- elsif page.layout == "article" -%}
17
+ {%- if _pageview -%}
18
+
19
+ {%- if jekyll.environment != "development" and
20
+ jekyll.environment != "beta" -%}
21
+ {%- if site.pageview.provider == 'leancloud' -%}
22
+ {%- include pageview-providers/leancloud/post.html -%}
23
+ {%- elsif site.pageview.provider == 'custom' -%}
24
+ {%- include pageview-providers/custom/post.html -%}
25
+ {%- endif -%}
26
+ {%- endif -%}
27
+
28
+ {%- endif -%}
29
+ {%- endif -%}
@@ -0,0 +1,98 @@
1
+ {%- if paginator.total_pages > 1 -%}
2
+ <div class="pagination">
3
+
4
+ {%- include snippets/get-locale-string.html key='STATISTICS' -%}
5
+ {%- assign _locale_statistics = __return -%}
6
+
7
+ {%- assign _post_count = site.posts | size -%}
8
+ {%- assign _page_count = paginator.total_pages -%}
9
+ <p>{{ _locale_statistics | replace: '[POST_COUNT]', _post_count | replace: '[PAGE_COUNT]', _page_count }}</p>
10
+ <div class="pagination__menu">
11
+ <ul class="menu menu--nowrap">
12
+ {%- assign _max_show = 5 -%}
13
+ {%- assign _max_show_modulo_two = _max_show | modulo: 2 -%}
14
+ {%- assign _length = paginator.total_pages -%}
15
+ {%- assign _length_mimus_one = _length | minus: 1 -%}
16
+ {%- assign _cur = paginator.page -%}
17
+ {%- assign _extra = _max_show | minus: 3 -%}
18
+ {%- assign _extra_half = _extra | divided_by: 2 -%}
19
+
20
+ {%- if _max_show > 4 and _max_show_modulo_two == 1 and paginator.total_pages > _max_show -%}
21
+ {%- assign _condition0 = _extra | divided_by: 2 | plus: 1 -%}
22
+ {%- assign _condition1 = _length | minus: _extra_half -%}
23
+ {%- if _cur <= _condition0 -%}
24
+ {%- assign _n0 = 2 -%}
25
+ {%- assign _n1 = _extra | plus: 2 -%}
26
+ {%- elsif _cur >= _condition1 -%}
27
+ {%- assign _n0 = _length | minus: _extra | minus: 1 -%}
28
+ {%- assign _n1 = _length | minus: 1 -%}
29
+ {%- else -%}
30
+ {%- assign _n0 = _cur | minus: _extra_half -%}
31
+ {%- assign _n1 = _cur | plus: _extra_half -%}
32
+ {%- endif -%}
33
+ {%- endif -%}
34
+
35
+ {%- if paginator.previous_page -%}
36
+ {%- include snippets/prepend-baseurl.html path=paginator.previous_page_path -%}
37
+ {%- assign _href = __return -%}
38
+ <li><a class="button button--secondary button--circle" href="{{ _href }}">
39
+ <i class="fas fa-angle-left"></i>
40
+ </a></li>
41
+ {%- else -%}
42
+ <li><div class="button button--secondary button--circle disabled">
43
+ <i class="fas fa-angle-left"></i>
44
+ </div></li>
45
+ {%- endif -%}
46
+
47
+ {%- for page in (1.._length) -%}
48
+ {%- if page == _cur -%}
49
+ <li>
50
+ <div class="button button--primary button--circle focus"><span>{{ page }}</span></div>
51
+ </li>
52
+
53
+ {%- elsif page == 1 -%}
54
+ {%- assign _home_path = site.paths.home | default: site.data.variables.default.paths.home -%}
55
+ {%- include snippets/prepend-baseurl.html path=_home_path -%}
56
+ {%- assign _href = __return -%}
57
+ <li>
58
+ <a class="button button--secondary button--circle" href="{{ _href }}"><span>{{ page }}</span></a>
59
+ </li>
60
+
61
+ {%- else -%}
62
+ {%- if _n0 and _n1 -%}
63
+ {%- if page > 1 and page < _n0 -%}
64
+ {%- if page == 2 -%}<li><span class="pagination__omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
65
+ {%- elsif page > _n1 and page < _length -%}
66
+ {%- if page == _length_mimus_one -%}<li><span class="pagination__omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
67
+ {%- else -%}
68
+ {%- include snippets/prepend-baseurl.html path=site.paginate_path -%}
69
+ {%- assign _href = __return -%}
70
+ <li>
71
+ <a class="button button--secondary button--circle" href="{{ _href | replace: ':num', page }}"><span>{{ page }}</span></a>
72
+ </li>
73
+ {%- endif -%}
74
+ {%- else -%}
75
+ {%- include snippets/prepend-baseurl.html path=site.paginate_path -%}
76
+ {%- assign _href = __return -%}
77
+ <li>
78
+ <a class="button button--secondary button--circle" href="{{ _href | replace: ':num', page }}"><span>{{ page }}</span></a>
79
+ </li>
80
+ {%- endif -%}
81
+ {%- endif -%}
82
+ {%- endfor -%}
83
+
84
+ {%- if paginator.next_page -%}
85
+ {%- include snippets/prepend-baseurl.html path=paginator.next_page_path -%}
86
+ {%- assign _href = __return -%}
87
+ <li><a class="button button--secondary button--circle" href="{{ _href }}">
88
+ <i class="fas fa-angle-right"></i>
89
+ </a></li>
90
+ {%- else -%}
91
+ <li><div class="button button--secondary button--circle disabled">
92
+ <i class="fas fa-angle-right"></i>
93
+ </div></li>
94
+ {%- endif -%}
95
+ </ul>
96
+ </div>
97
+ </div>
98
+ {%- endif -%}