jekyll-theme-h2o-ac 1.3.0 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/_config.yml +12 -17
  3. data/_data/collections.yml +2 -2
  4. data/_includes/{footer.html → layouts/footer.html} +9 -4
  5. data/_includes/{post-head.html → layouts/head.html} +36 -29
  6. data/_includes/{header.html → layouts/header.html} +24 -0
  7. data/_includes/layouts/metainfo.html +40 -0
  8. data/_includes/{paginate-article.html → layouts/paginate-article.html} +8 -1
  9. data/_includes/{paginate.html → layouts/paginate.html} +5 -5
  10. data/_includes/{sidebar.html → layouts/sidebar.html} +10 -9
  11. data/_includes/layouts/submenu.html +30 -0
  12. data/_includes/plugins/analytics/analytics.html +3 -0
  13. data/_includes/{analytics.html → plugins/analytics/google.html} +1 -2
  14. data/_includes/plugins/comments/comments_block.html +67 -0
  15. data/_includes/plugins/comments/comments_js.html +24 -0
  16. data/_includes/plugins/comments/disqus.html +19 -0
  17. data/_includes/plugins/comments/waline_css.html +3 -0
  18. data/_includes/plugins/comments/waline_js.html +14 -0
  19. data/_includes/plugins/i18n.html +32 -0
  20. data/_includes/plugins/markdown/fancybox_css.html +1 -0
  21. data/_includes/plugins/markdown/fancybox_js.html +24 -0
  22. data/_includes/plugins/markdown/hotkeys.html +31 -0
  23. data/_includes/plugins/markdown/markdown.html +7 -0
  24. data/_includes/plugins/markdown/mermaid_block.html +10 -0
  25. data/_includes/plugins/markdown/mermaid_js.html +12 -0
  26. data/_includes/plugins/markdown/prism_css.html +16 -0
  27. data/_includes/plugins/markdown/prism_js.html +3 -0
  28. data/_includes/{calendar.html → plugins/others/calendar_block.html} +1 -1
  29. data/_includes/plugins/others/calendar_css.html +3 -0
  30. data/_includes/plugins/others/calendar_js.html +8 -0
  31. data/_includes/plugins/others/social_block.html +5 -0
  32. data/_includes/plugins/others/social_css.html +1 -0
  33. data/_includes/plugins/others/social_js.html +15 -0
  34. data/_includes/plugins/search/docsearch_css.html +3 -0
  35. data/_includes/plugins/search/docsearch_js.html +19 -0
  36. data/_layouts/404.html +17 -0
  37. data/_layouts/archives.html +70 -65
  38. data/_layouts/blog.html +4 -10
  39. data/_layouts/categories.html +3 -1
  40. data/_layouts/default.html +64 -54
  41. data/_layouts/page.html +17 -87
  42. data/_layouts/post.html +145 -434
  43. data/_layouts/stats.html +32 -2
  44. data/_layouts/tags.html +2 -2
  45. data/assets/css/app.min.css +1 -1
  46. data/assets/css/app.min.css.map +1 -1
  47. data/assets/js/app.min.js +1 -1
  48. data/assets/js/app.min.js.map +1 -1
  49. metadata +42 -22
  50. data/_includes/comments.html +0 -53
  51. data/_includes/head.html +0 -51
  52. data/_includes/mermaid.html +0 -12
  53. data/_includes/submenu.html +0 -20
  54. data/_includes/waline.html +0 -3
  55. /data/_includes/{pageNav.html → layouts/pageNav.html} +0 -0
  56. /data/_includes/{toc.html → layouts/toc.html} +0 -0
  57. /data/_includes/{busuanzi.html → plugins/analytics/busuanzi.html} +0 -0
  58. /data/_includes/{umami.html → plugins/analytics/umami.html} +0 -0
  59. /data/_includes/{mathjax.html → plugins/markdown/mathjax.html} +0 -0
  60. /data/_includes/{pwa.html → plugins/others/pwa.html} +0 -0
  61. /data/_includes/{webpusher.html → plugins/others/webpusher.html} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 639e64a94b17f1be8b23d2b74aa1092806383cc573f1a1a724b1ec0ca7c2d2b3
4
- data.tar.gz: 9bf22e2a1e22b29266543005ecffffd9330f255d71927b4dfccbe6bdc6a13437
3
+ metadata.gz: 0eae90d54e8e7e140555d14c23ddd08c2dfa02f61db9cb34a2be65c250a29de3
4
+ data.tar.gz: 443b4a50138f0374806aae150d370786058692f0ccb774de52ff772ba870dc84
5
5
  SHA512:
6
- metadata.gz: f808b5bddfa7c433e10c74314b46cc343bd6a11f1b9afabf6ec8a917b4ac45755243d7c638dc059355a7b4089cb2db0d75ae82718943fa7efcac1155ca523403
7
- data.tar.gz: 53a3be7033dfd2f356044e965e6e7951bd3f9cae03ff5fc27ac92af8ae10370ecde24c07dc5fa4bf86c530158c6e88d38da6c79f90f4362da48477c4674731ac
6
+ metadata.gz: d05f5bbc8bd8884ebd43896ee5937dd1f18375257c7365c271921a5035c01242574ea7d7ce6f5f616c4dda0cf69aa1646c93455b64014fe799ae6eaf42519f3a
7
+ data.tar.gz: '08d688227958012ddddb6079fa75b77e2642f9697d60f3ff063620e099842e335dda0125d91755d2d647cd3780a00319a0853c93932d0bbf23e2adc1fdc16380'
data/_config.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  # jekyll-theme-h2o-ac
2
- version: 1.3.0
2
+ version: 1.3.2
3
3
 
4
4
  # Site settings 配置站点
5
5
  title: 'Mr Li'
@@ -112,6 +112,17 @@ supports:
112
112
  upyun:
113
113
  webify:
114
114
 
115
+ # Badges
116
+ badges:
117
+ foreverblog: true # Foreverblog
118
+ wormhole: true # Wormhole
119
+ travelling: true # Travelling
120
+ notbyAI: true # NotByAI
121
+
122
+ # Alive time
123
+ alivetime: true
124
+ alivestart: "12/23/2021"
125
+
115
126
  # Beian 备案号
116
127
  beian: '沪ICP备xxxxxxxx号'
117
128
 
@@ -186,22 +197,6 @@ extlinks:
186
197
  # Mermaid
187
198
  mermaid: true
188
199
 
189
- # Webpusher
190
- webpusher: false
191
-
192
- # Foreverblog
193
- foreverblog: false
194
-
195
- # Wormhole
196
- wormhole: false
197
-
198
- # NotByAI
199
- notbyAI: false
200
-
201
- # Alive time
202
- alivetime: false
203
- alivestart: "12/23/2021"
204
-
205
200
  # TOC
206
201
  toc: true
207
202
  # <div class="title">{% if title %} {{title}} {% else %} {{default_title}} {% endif %}</div>
@@ -7,5 +7,5 @@
7
7
  url: '/tech/new-theme-h2o-ac.html'
8
8
  - name: '快速入门'
9
9
  url: '/tech/new-theme-h2o-ac.html'
10
-
11
-
10
+ - name: 'Guide'
11
+ url: 'https://lisz.me/tech/new-theme-h2o-ac.html'
@@ -60,19 +60,24 @@
60
60
  <a href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" target="_blank" class="extlinks">{{ footer.upyun }} <img src="{{ "/assets/icons/upyun.png" | relative_url }}" class="upyun" alt="upyun" /></a>
61
61
  </section>
62
62
  {% endif %}
63
- {% if site.foreverblog or site.wormhole or site.notbyAI %}
63
+ {% if site.badges.foreverblog or site.badges.wormhole or site.badges.travelling or site.badges.notbyAI %}
64
64
  <section class="badges">
65
- {% if site.foreverblog %}
65
+ {% if site.badges.foreverblog %}
66
66
  <a href="https://www.foreverblog.cn/" target="_blank" class="foreverblog" aria-label="foreverblog">
67
67
  <img src="https://img.foreverblog.cn/logo_en_default.png" alt="">
68
68
  </a>
69
69
  {% endif %}
70
- {% if site.wormhole %}
70
+ {% if site.badges.wormhole %}
71
71
  <a href="https://www.foreverblog.cn/go.html" target="_blank" class="wormhole" aria-label="wormhole">
72
72
  <img src="https://img.foreverblog.cn/wormhole_3.gif" alt="" title="穿梭虫洞-随机访问十年之约友链博客">
73
73
  </a>
74
74
  {% endif%}
75
- {% if site.notbyAI %}
75
+ {% if site.badges.travelling %}
76
+ <a href="https://www.travellings.cn/go.html" target="_blank" class="travelling-badge" aria-label="Travelling" rel="noopener" title="开往-友链接力">
77
+ <img src="https://www.travellings.cn/assets/logo.gif" alt="开往-友链接力">
78
+ </a>
79
+ {% endif %}
80
+ {% if site.badges.notbyAI %}
76
81
  <a href="https://notbyai.fyi/" target="_blank" class="notbyAI" aria-label="notbyAI">
77
82
  <img src="{{ "/assets/icons/notbyAI-white.png" | prepend: site.baseurl }}" alt="Written by Human, Not by AI">
78
83
  </a>
@@ -2,23 +2,21 @@
2
2
  <meta charset="UTF-8">
3
3
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
4
4
  <title>{% if page.title %}{{ page.title }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
5
- <meta name="author" content="{{ site.author }}">
5
+ <meta name="author" content="{{ site.author }}">
6
+ {% if layout.type == "post" %}
6
7
  <meta name="description" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
7
- <meta name="keywords" content="{% if page.tags.size > 0 %}{% for tag in page.tags %}{{ tag }}{% if forloop.last == false %}, {% endif %}{% endfor %}{% endif %}">
8
- <!-- Open Graph -->
9
- <meta property="og:title" content="{% if page.title %}{{ page.title }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}">
10
- <meta property="og:type" content="website">
11
- <meta property="og:url" content="{{ page.url | prepend: site.url }}">
12
- <meta property="og:baseurl" content="{{ site.baseurl }}">
13
- <meta property="og:description" content="{{ site.description }}">
14
- <meta property="og:site_name" content="{{ site.title }}">
15
- <meta property="og:gray" content="{{ site.gray }}">
8
+ <meta name="keywords"
9
+ content="{% if page.tags.size > 0 %}{% for tag in page.tags %}{{ tag }}{% if forloop.last == false %}, {% endif %}{% endfor %}{% endif %}">
16
10
  {% if page.next.url %}
17
11
  <meta property="og:previous_url" content="{{ page.next.url | relative_url }}">
18
12
  {% endif %}
19
13
  {% if page.previous.url %}
20
14
  <meta property="og:next_url" content="{{ page.previous.url | relative_url }}">
21
15
  {% endif %}
16
+ {% else %}
17
+ <meta name="description" content="{{ site.description }}">
18
+ <meta name="keywords" content="{{ site.keyword }}">
19
+ {% endif %}
22
20
  <meta property="post-date-format" content="{{ site.formats.time }}">
23
21
  {% case site.formats.time %}
24
22
  {% when 0 %}
@@ -28,6 +26,21 @@
28
26
  {% else %}
29
27
  <meta property="post-date" content="{{ page.date | date: '%Y年%-m月%-d日 %H:%M:%S %z' }}" />
30
28
  {% endcase %}
29
+ {% if site.calendar %}
30
+ <meta property="calendar-scale" content="{{ site.calendar.scale | default: 'year' }}" />
31
+ <meta property="calendar-scheme" content="{{ site.calendar.scheme | default: 'null' }}" />
32
+ <meta property="calendar-color" content="{{ site.calendar.color | default: 'null' }}" />
33
+ {% endif %}
34
+ <!-- Open Graph -->
35
+ <meta property="og:title"
36
+ content="{% if page.title %}{{ page.title }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}">
37
+ <meta property="og:type" content="website">
38
+ <meta property="og:url" content="{{ page.url | prepend: site.url }}">
39
+ <meta property="og:baseurl" content="{{ site.baseurl }}">
40
+ <meta property="og:description" content="{{ site.description }}">
41
+ <meta property="og:site_name" content="{{ site.title }}">
42
+ <meta property="og:gray" content="{{ site.gray }}">
43
+ <meta property="og:lang" content="{{ lang }}">
31
44
  {% if site.alivetime %}
32
45
  <meta name="alivestart" content="{{ site.alivestart }}">
33
46
  {% endif %}
@@ -35,29 +48,23 @@
35
48
  <meta name="google-site-verification" content="{{ site.google_search }}" />
36
49
  {% endif %}
37
50
  <meta name="theme-color" content="{{ site.pwa.color }}" />
38
- <link rel="manifest" href="{{ "/manifest.json" | prepend: site.baseurl }}" />
39
- <link rel="apple-touch-icon" href="{{ site.baseurl }}/assets/img/touch/apple-touch-icon.png"/>
51
+ <link rel="manifest" href="{{ " /manifest.json" | prepend: site.baseurl }}" />
52
+ <link rel="apple-touch-icon" href="{{ " /assets/img/touch/apple-touch-icon.png" | prepend: site.baseurl }}" />
40
53
  <link rel="Shortcut Icon" href="{{ site.favicon | prepend: site.baseurl }}">
41
54
  <link rel="icon" href="{{ site.favicon | prepend: site.baseurl }}" type="image/x-icon" />
42
55
  <link rel="bookmark" href="{{ site.favicon | prepend: site.baseurl }}" type="image/x-icon" />
43
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.min.css" />
56
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.min.css" async>
44
57
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" />
45
58
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.2.0/github-markdown-light.min.css">
46
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
47
- {% assign prisms1 = "coy,dark,funky,okaidia,solarizedlight,tomorrow,twilight" | split: "," %}
48
- {% assign prisms2 = "a11y-dark,atom-dark,base16-ateliersulphurpool.light,cb,coldark-cold,coy-without-shadows,darcula,duotone-dark,duotone-earth,duotone-light,dutone-sea,dutone-space,ghcolors,gruvbox-dark,gruvbox-light,holi-theme,hopscotch,lucario,material-dark,material-light,material-oceanic,night-owl,nord,one-dark,one-light,pojoaque,shades-of-purple,solarized-dark-atom,synthwave84,vs,vsc-dark-plus,xonokai,z-touch" | split: "," %}
49
- {% if prisms1 contains site.prism.theme %}
50
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.28.0/themes/prism-{{site.prism.theme}}.min.css" />
51
- {% else if prisms2 contains site.prism.theme %}
52
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prism-themes@1.9.0/themes/prism-{{site.prism.theme}}.min.css" />
59
+ {% if layout.type == "post" %}
60
+ {% include plugins/others/social_css.html%}
61
+ {% include plugins/markdown/fancybox_css.html %}
53
62
  {% else %}
54
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.28.0/themes/prism.min.css" />
55
- {% endif %}
56
- {% if site.prism.line_numbers %}
57
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.28.0/plugins/line-numbers/prism-line-numbers.min.css">
63
+ {% include plugins/others/calendar_css.html %}
58
64
  {% endif %}
59
- <link rel="stylesheet" href="{{ "/assets/css/app.min.css" | prepend: site.baseurl }}">
60
- <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.min.css" />
61
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css" />
62
- <script src="//cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
63
- </head>
65
+ {% include plugins/markdown/prism_css.html %}
66
+ {% include plugins/comments/waline_css.html %}
67
+ {% include plugins/search/docsearch_css.html %}
68
+ <link rel="stylesheet" href="{{ " /assets/css/app.min.css" | prepend: site.baseurl }}">
69
+ <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
70
+ </head>
@@ -3,6 +3,18 @@
3
3
  <a href="{{ "/" | relative_url }}" aria-label="logo"></a>
4
4
  </div>
5
5
  <!-- <i id="menu-toggle" class="iconfont icon-menu"></i> -->
6
+ {% if site.search and site.search_type == "docsearch" %}
7
+ <div id="search-toggle"></div>
8
+ {% endif %}
9
+ {% if site.badges.travelling %}
10
+ <div id="travelling-toggle">
11
+ <a href="https://www.travellings.cn/go.html" aria-label="Travelings" target="_blank">
12
+ <svg class="icon" aria-hidden="true">
13
+ <use xlink:href="#icon-train-subway"></use>
14
+ </svg>
15
+ </a>
16
+ </div>
17
+ {% endif %}
6
18
  <div id="mode-toggle">
7
19
  <svg class="icon icon-day" aria-hidden="true">
8
20
  <use xlink:href="#icon-day"></use>
@@ -38,6 +50,15 @@
38
50
  </li>
39
51
  {% endif %}
40
52
  {% endfor %}
53
+ {% if site.badges.travelling %}
54
+ <li class="travelling">
55
+ <a href="https://www.travellings.cn/go.html" aria-label="Travelings" target="_blank">
56
+ <svg class="icon" aria-hidden="true">
57
+ <use xlink:href="#icon-train-subway"></use>
58
+ </svg>
59
+ </a>
60
+ </li>
61
+ {% endif %}
41
62
  <li class="mode">
42
63
  <svg class="icon day" aria-hidden="true">
43
64
  <use xlink:href="#icon-day"></use>
@@ -46,6 +67,9 @@
46
67
  <use xlink:href="#icon-night"></use>
47
68
  </svg>
48
69
  </li>
70
+ {% if site.search and site.search_type == "docsearch" %}
71
+ <li id="search"></li>
72
+ {% endif %}
49
73
  </ul>
50
74
  </nav>
51
75
  </header>
@@ -0,0 +1,40 @@
1
+ <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/dayjs.min.js"></script>
2
+ <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/customParseFormat.js"></script>
3
+ <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/relativeTime.js"></script>
4
+ <script>
5
+ $(document).ready(function () {
6
+ var time_formats = ['YYYY-MM-DD HH:mm:ss ZZ', 'YYYY DD MMM HH:mm:ss ZZ', 'YYYY年MM月DD日 HH:mm:ss ZZ'];
7
+ function dateFormat(date, format) {
8
+ var date_org = dayjs(date, time_formats[format]);
9
+ var date = date_org.format(time_formats[format]);
10
+ return { "date_org": date_org, "date": date }
11
+ }
12
+
13
+ dayjs.extend(window.dayjs_plugin_customParseFormat);
14
+ dayjs.extend(window.dayjs_plugin_relativeTime);
15
+ var post_date = $("meta[property='post-date']").attr('content');
16
+ var post_date_format = $("meta[property='post-date-format']").attr('content');
17
+ var local_post_date = dateFormat(post_date, post_date_format);
18
+
19
+ $(".post time span.create-at").html(local_post_date["date"]);
20
+
21
+ fetch("https://api.github.com/repos/{{ site.github.owner }}/{{ site.github.repository }}/commits?path={{ page.path }}").then((response) => {
22
+ return response.json();
23
+ }).then((commits) => {
24
+ if (commits.length != 0) {
25
+ var update_at = dayjs(commits[0]['commit']['committer']['date']);
26
+ } else {
27
+ var update_at = post_date
28
+ }
29
+
30
+ var local_update_at = dateFormat(update_at, post_date_format);
31
+ $('.post time span.update-at').html(local_update_at["date"]);
32
+
33
+ var relative_time = dayjs().diff(local_update_at["date_org"], 'day');
34
+ $(".post-copyright .tips span").append(relative_time);
35
+ if (relative_time > 365) {
36
+ $(".post-copyright .tips").addClass("active");
37
+ }
38
+ });
39
+ });
40
+ </script>
@@ -11,7 +11,14 @@
11
11
  {% endif %}
12
12
  <section class="post-preview">
13
13
  <a class="post-link" href="{{ post.url | relative_url }}" title="{{ post.title }}"></a>
14
- <h2 class="post-title">{% if post.pin %}<span class="keep-top">[置顶]</span> {% endif %}{{ post.title }}</h2>
14
+ <h2 class="post-title">
15
+ {% if post.pin %}
16
+ <svg class="icon" aria-hidden="true">
17
+ <use xlink:href="#icon-pin"></use>
18
+ </svg>
19
+ {% endif %}
20
+ {{ post.title }}
21
+ </h2>
15
22
  {% if post.subtitle %}
16
23
  <h3 class="post-subtitle">{{ post.subtitle }}</h3>
17
24
  {% endif %}
@@ -15,13 +15,13 @@
15
15
  {% endif %}
16
16
  {% for i in (unpin_start..unpin_end) %}
17
17
  {% assign post = unpin_posts[i] %}
18
- {% include paginate-article.html %}
18
+ {% include layouts/paginate-article.html %}
19
19
  {% endfor %}
20
20
  {% elsif pin_posts_num < max_num %}
21
21
  {% assign pin_end = pin_posts_num | minus: 1 %}
22
22
  {% for i in (min_num..pin_end) %}
23
23
  {% assign post = pin_posts[i] %}
24
- {% include paginate-article.html %}
24
+ {% include layouts/paginate-article.html %}
25
25
  {% endfor %}
26
26
  {% assign unpin_end = max_num | minus: pin_posts_num | minus: 1 %}
27
27
  {% if unpin_end >= unpin_posts_num %}
@@ -29,13 +29,13 @@
29
29
  {% endif %}
30
30
  {% for i in (0..unpin_end) %}
31
31
  {% assign post = unpin_posts[i] %}
32
- {% include paginate-article.html %}
32
+ {% include layouts/paginate-article.html %}
33
33
  {% endfor %}
34
34
  {% else %}
35
35
  {% assign pin_start = min_num %}
36
36
  {% assign pin_end = max_num | minus: 1 %}
37
37
  {% for i in (pin_start..pin_end) %}
38
38
  {% assign post = pin_posts[i] %}
39
- {% include paginate-article.html %}
39
+ {% include layouts/paginate-article.html %}
40
40
  {% endfor %}
41
- {% endif %}
41
+ {% endif %}
@@ -46,7 +46,7 @@
46
46
  {% endif %}
47
47
  </section>
48
48
  {% if site.calendar %}
49
- {% include calendar.html %}
49
+ {% include plugins/others/calendar_block.html %}
50
50
  {% endif %}
51
51
  {% if site.recommend-tags and site.tags.size>0 %}
52
52
  {% assign max_tag_count = 0 %}
@@ -127,13 +127,14 @@
127
127
  </div>
128
128
 
129
129
  {% if site.search %}
130
- <div class="search-card">
131
- <input id="search_input" type="text" placeholder="Search..." autocomplete="off">
132
- <svg class="icon" aria-hidden="true">
133
- <use xlink:href="#icon-search"></use>
134
- </svg>
135
- <div class="search_result"></div>
136
- </div>
130
+ {% if site.search_type == "default" or site.search_type == nil %}
131
+ <div class="search-card">
132
+ <input id="search_input" type="text" placeholder="Search..." autocomplete="off">
133
+ <svg class="icon" aria-hidden="true">
134
+ <use xlink:href="#icon-search"></use>
135
+ </svg>
136
+ <div class="search_result"></div>
137
+ </div>
138
+ {% endif %}
137
139
  {% endif %}
138
-
139
140
  </aside>
@@ -0,0 +1,30 @@
1
+ {% if page.submenu %}
2
+ <div class="submenu">
3
+ {% for collection in site.data.collections %}
4
+ {% if collection.id == page.submenu %}
5
+ <h4>
6
+ <svg class="icon" aria-hidden="true">
7
+ <use xlink:href="#icon-submenu"></use>
8
+ </svg>{{ collection.name }}
9
+ </h4>
10
+ <ul>
11
+ {% for article in collection.articles %}
12
+ <li>
13
+ {% if article.url contains "://" %}
14
+ <a href="{{ article.url }}" class="extlinks">
15
+ {{ article.name }}
16
+ </a>
17
+ {% else %}
18
+ <a href="{{ article.url | prepend: site.baseurl }}">
19
+ {{ article.name }}
20
+ </a>
21
+ {% endif %}
22
+ </li>
23
+ {% endfor %}
24
+ </ul>
25
+ {% endif %}
26
+ {% endfor %}
27
+ {% else %}
28
+ <div class="submenu hidden">
29
+ {% endif %}
30
+ </div>
@@ -0,0 +1,3 @@
1
+ {% include plugins/analytics/google.html %}
2
+ {% include plugins/analytics/umami.html %}
3
+ {% include plugins/analytics/busuanzi.html %}
@@ -3,9 +3,8 @@
3
3
  <script async src="https://www.googletagmanager.com/gtag/js?id={{site.google_analytics}}"></script>
4
4
  <script>
5
5
  window.dataLayer = window.dataLayer || [];
6
- function gtag(){dataLayer.push(arguments);}
6
+ function gtag() { dataLayer.push(arguments); }
7
7
  gtag('js', new Date());
8
-
9
8
  gtag('config', '{{site.google_analytics}}');
10
9
  </script>
11
10
  {% endif %}
@@ -0,0 +1,67 @@
1
+ {% capture block %}
2
+ <section class="post-footer-item comment">
3
+ <div class="comments-headline">
4
+ <svg class="icon" aria-hidden="true">
5
+ <use xlink:href="#icon-comment"></use>
6
+ </svg>
7
+ <span>{{ locales.post.comment }}</span>
8
+ </div>
9
+ {% if layout.type == "post" %}
10
+ {% if site.comments.disqus and site.comments.waline %}
11
+ <div id="comments-switch">
12
+ <span class="first-comment">Disqus</span>
13
+ <span class="switch-button">
14
+ <input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox">
15
+ <label for="cmn-toggle-4"></label>
16
+ </span>
17
+ <span class="second-comment">Waline</span>
18
+ </div>
19
+ {% endif %}
20
+ {% else %}
21
+ {% if page.comments.disqus and page.comments.waline %}
22
+ <div id="comments-switch">
23
+ <span class="first-comment">Disqus</span>
24
+ <span class="switch-button">
25
+ <input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox">
26
+ <label for="cmn-toggle-4"></label>
27
+ </span>
28
+ <span class="second-comment">Waline</span>
29
+ </div>
30
+ {% endif %}
31
+ {% endif %}
32
+ </section>
33
+ {% endcapture %}
34
+
35
+ {% if layout.type == "post" %}
36
+ {% if site.comments.disqus or site.comments.waline or page.comments.waline or page.comments.disqus %}
37
+ {{ block }}
38
+ {% endif %}
39
+ {% else %}
40
+ {% if page.comments.disqus or page.comments.waline %}
41
+ {{ block }}
42
+ {% endif %}
43
+ {% endif %}
44
+
45
+ {% if layout.type == "post" %}
46
+ {% if site.comments.disqus %}
47
+ <section class="post-footer-item comment">
48
+ <div id="disqus_thread"></div>
49
+ </section>
50
+ {% endif %}
51
+ {% if site.comments.waline %}
52
+ <section class="post-footer-item comment">
53
+ <div id="waline"></div>
54
+ </section>
55
+ {% endif %}
56
+ {% else %}
57
+ {% if page.comments.disqus %}
58
+ <section class="post-footer-item comment">
59
+ <div id="disqus_thread"></div>
60
+ </section>
61
+ {% endif %}
62
+ {% if page.comments.waline %}
63
+ <section class="post-footer-item comment">
64
+ <div id="waline"></div>
65
+ </section>
66
+ {% endif %}
67
+ {% endif %}
@@ -0,0 +1,24 @@
1
+ {% include plugins/comments/disqus.html %}
2
+ {% include plugins/comments/waline_js.html %}
3
+ <script>
4
+ $(document).ready(function () {
5
+ if ($("#comments-switch").length > 0) {
6
+ var comment_status = $("#cmn-toggle-4")[0].checked;
7
+ if (comment_status) {
8
+ $("#waline").addClass("active");
9
+ } else {
10
+ $("#disqus_thread").addClass("active");
11
+ }
12
+ $("#cmn-toggle-4").click(function () {
13
+ $("#disqus_thread").toggleClass("active");
14
+ $("#waline").toggleClass("active");
15
+ })
16
+ } else {
17
+ if ($("#disqus_thread").length > 0) {
18
+ $("#disqus_thread").addClass("active");
19
+ } else if ($("#waline").length > 0) {
20
+ $("#waline").addClass("active");
21
+ }
22
+ }
23
+ })
24
+ </script>
@@ -0,0 +1,19 @@
1
+ {% if site.comments.disqus or page.comments.disqus %}
2
+ <script>
3
+ /**
4
+ * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
5
+ * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
6
+ /*
7
+ var disqus_config = function () {
8
+ this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
9
+ this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
10
+ };
11
+ */
12
+ (function () { // DON'T EDIT BELOW THIS LINE
13
+ var d = document, s = d.createElement('script');
14
+ s.src = '{{ site.comments.disqus_url }}';
15
+ s.setAttribute('data-timestamp', +new Date());
16
+ (d.head || d.body).appendChild(s);
17
+ })();
18
+ </script>
19
+ {% endif %}
@@ -0,0 +1,3 @@
1
+ {% if site.comments.waline or page.comments.waline %}
2
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css" />
3
+ {% endif %}
@@ -0,0 +1,14 @@
1
+ {% if site.comments.waline or page.comments.waline %}
2
+ <script src="https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.umd.js"></script>
3
+ <script>
4
+ $(document).ready(function () {
5
+ Waline.init({
6
+ el: '#waline',
7
+ serverURL: '{{ site.comments.waline_url }}',
8
+ reaction: {{ site.comments.waline_reaction }},
9
+ comment: true,
10
+ locale: {{ site.comments.waline_locale }}
11
+ });
12
+ });
13
+ </script>
14
+ {% endif %}
@@ -0,0 +1,32 @@
1
+ {% assign lang = page.lang | default: site.default_lang %}
2
+ {% assign locales = site.data.locales[lang] %}
3
+ {% if page.langs %}
4
+ <p>
5
+ <b>{{ locales.langs }}</b>
6
+ {% assign langs = "zh-Hans, zh-Hant, en, ja" | split: ", " %}
7
+ {% assign langnames = "简中, 繁中, EN, 日本語" | split: ", " %}
8
+ {% if lang == site.default_lang %}
9
+ {% assign url = page.url %}
10
+ {% else %}
11
+ {% assign urls = page.url | split: '/' %}
12
+ {% assign url = "" %}
13
+ {% for u in urls offset:2 %}
14
+ {% assign url = url | append: "/" | append: u %}
15
+ {% endfor %}
16
+ {% endif %}
17
+ {% for l in page.langs %}
18
+ {% for i in (0..4) %}
19
+ {% if langs[i] == l %}
20
+ {% if l == page.lang %}
21
+ {{ langnames[i] }}
22
+ {% elsif l == site.default_lang %}
23
+ <a href="{{ url }}">{{ langnames[i] }}</a>
24
+ {% else %}
25
+ {% assign prefix = "/" | append: l %}
26
+ <a href="{{ url | prepend: prefix }}">{{ langnames[i] }}</a>
27
+ {% endif %}
28
+ {% endif %}
29
+ {% endfor %}
30
+ {% endfor %}
31
+ </p>
32
+ {% endif %}
@@ -0,0 +1 @@
1
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.min.css" />
@@ -0,0 +1,24 @@
1
+ <script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.min.js"></script>
2
+ <script>
3
+ $(document).ready(function () {
4
+ var baseurl = $("meta[property='og:baseurl']").attr('content');
5
+ $("p img").each(function () {
6
+ $(this).attr('data-src', $(this).attr('src')).removeAttr('src').addClass("lazyload").attr('src', baseurl + '/assets/img/loading.gif');
7
+ var strA = "<a data-fancybox='gallery' ref='gallery' href='" + $(this).attr('data-src') + "' data-caption='" + $(this).attr('alt') + "'></a>";
8
+ $(this).wrapAll(strA);
9
+ var caption = $(this)[0].alt;
10
+ $(this).parent().after('<span class="caption">' + caption + '</span>');
11
+ });
12
+ Fancybox.bind('[data-fancybox]', {
13
+ on: {
14
+ load: (fancybox, slide) => {
15
+ var gray = $("meta[property='og:gray']").attr('content');
16
+ if (gray == "true") {
17
+ $(".fancybox__content img").addClass("gray");
18
+ $(".carousel__track .fancybox__thumb").addClass("gray");
19
+ }
20
+ }
21
+ }
22
+ });
23
+ });
24
+ </script>
@@ -0,0 +1,31 @@
1
+ <script src="https://cdn.jsdelivr.net/npm/hotkeys-js/dist/hotkeys.min.js"></script>
2
+ <script>
3
+ $(document).ready(function () {
4
+ var previous_url = $("meta[property='og:previous_url']").attr('content');
5
+ var next_url = $("meta[property='og:next_url']").attr('content');
6
+
7
+ hotkeys('left', function (event, handler) {
8
+ // Prevent the default refresh event under WINDOWS system
9
+ event.preventDefault();
10
+ if (previous_url) {
11
+ console.log('you pressed left!');
12
+ window.location.href = previous_url;
13
+ } else {
14
+ $("#no-previous").addClass("active");
15
+ setTimeout(function () { $("#no-previous").removeClass("active"); }, 1500);
16
+ }
17
+ });
18
+
19
+ hotkeys('right', function (event, handler) {
20
+ // Prevent the default refresh event under WINDOWS system
21
+ event.preventDefault();
22
+ if (next_url) {
23
+ console.log('you pressed right!');
24
+ window.location.href = next_url;
25
+ } else {
26
+ $("#no-next").addClass("active");
27
+ setTimeout(function () { $("#no-next").removeClass("active"); }, 1500);
28
+ }
29
+ });
30
+ });
31
+ </script>