jekyll-theme-chirpy 5.0.2 → 6.2.2

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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -74
  3. data/_data/locales/ar.yml +91 -0
  4. data/_data/locales/bg-BG.yml +81 -0
  5. data/_data/locales/cs-CZ.yml +89 -0
  6. data/_data/locales/de-DE.yml +80 -0
  7. data/_data/locales/el-GR.yml +91 -0
  8. data/_data/locales/en.yml +23 -23
  9. data/_data/locales/es-ES.yml +77 -0
  10. data/_data/locales/fi-FI.yml +90 -0
  11. data/_data/locales/fr-FR.yml +77 -0
  12. data/_data/locales/hu-HU.yml +79 -0
  13. data/_data/locales/id-ID.yml +5 -19
  14. data/_data/locales/it-IT.yml +90 -0
  15. data/_data/locales/ko-KR.yml +12 -19
  16. data/_data/locales/my-MM.yml +77 -0
  17. data/_data/locales/pt-BR.yml +77 -0
  18. data/_data/locales/ru-RU.yml +77 -0
  19. data/_data/locales/sl-SI.yml +91 -0
  20. data/_data/locales/sv-SE.yml +91 -0
  21. data/_data/locales/th.yml +91 -0
  22. data/_data/locales/tr-TR.yml +77 -0
  23. data/_data/locales/uk-UA.yml +77 -0
  24. data/_data/locales/vi-VN.yml +76 -0
  25. data/_data/locales/zh-CN.yml +13 -20
  26. data/_data/locales/zh-TW.yml +83 -0
  27. data/_data/origin/basic.yml +48 -0
  28. data/_data/origin/cors.yml +59 -0
  29. data/_includes/comments/disqus.html +27 -31
  30. data/_includes/comments/giscus.html +64 -0
  31. data/_includes/comments/utterances.html +2 -2
  32. data/_includes/datetime.html +20 -0
  33. data/_includes/embed/twitch.html +4 -0
  34. data/_includes/embed/youtube.html +6 -0
  35. data/_includes/footer.html +31 -32
  36. data/_includes/head.html +66 -46
  37. data/_includes/js-selector.html +83 -45
  38. data/_includes/jsdelivr-combine.html +26 -0
  39. data/_includes/lang.html +1 -1
  40. data/_includes/mermaid.html +30 -29
  41. data/_includes/metadata-hook.html +1 -0
  42. data/_includes/mode-toggle.html +66 -51
  43. data/_includes/notification.html +24 -0
  44. data/_includes/origin-type.html +13 -0
  45. data/_includes/post-nav.html +26 -22
  46. data/_includes/post-paginator.html +79 -76
  47. data/_includes/post-sharing.html +27 -16
  48. data/_includes/read-time.html +17 -10
  49. data/_includes/refactor-content.html +129 -73
  50. data/_includes/related-posts.html +48 -58
  51. data/_includes/search-loader.html +32 -31
  52. data/_includes/search-results.html +4 -5
  53. data/_includes/sidebar.html +79 -67
  54. data/_includes/toc.html +4 -7
  55. data/_includes/topbar.html +62 -56
  56. data/_includes/trending-tags.html +15 -19
  57. data/_includes/update-list.html +14 -15
  58. data/_layouts/archives.html +25 -29
  59. data/_layouts/categories.html +97 -58
  60. data/_layouts/category.html +8 -10
  61. data/_layouts/default.html +67 -31
  62. data/_layouts/home.html +67 -56
  63. data/_layouts/page.html +20 -58
  64. data/_layouts/post.html +85 -94
  65. data/_layouts/tag.html +8 -10
  66. data/_layouts/tags.html +6 -5
  67. data/_sass/addon/commons.scss +679 -878
  68. data/_sass/addon/module.scss +70 -23
  69. data/_sass/addon/syntax.scss +127 -110
  70. data/_sass/addon/variables.scss +16 -18
  71. data/_sass/colors/syntax-dark.scss +138 -0
  72. data/_sass/colors/syntax-light.scss +179 -0
  73. data/_sass/colors/{dark-typography.scss → typography-dark.scss} +58 -56
  74. data/_sass/colors/typography-light.scss +110 -0
  75. data/_sass/layout/archives.scss +86 -89
  76. data/_sass/layout/categories.scss +29 -13
  77. data/_sass/layout/category-tag.scss +9 -10
  78. data/_sass/layout/home.scss +132 -114
  79. data/_sass/layout/post.scss +213 -173
  80. data/_sass/layout/tags.scss +1 -1
  81. data/_sass/main.scss +13 -0
  82. data/assets/404.html +1 -20
  83. data/assets/css/jekyll-theme-chirpy.scss +6 -0
  84. data/assets/feed.xml +2 -2
  85. data/assets/js/data/search.json +8 -5
  86. data/assets/js/data/swcache.js +14 -29
  87. data/assets/js/dist/categories.min.js +2 -4
  88. data/assets/js/dist/commons.min.js +2 -4
  89. data/assets/js/dist/home.min.js +2 -4
  90. data/assets/js/dist/misc.min.js +4 -0
  91. data/assets/js/dist/page.min.js +2 -4
  92. data/assets/js/dist/post.min.js +2 -4
  93. data/assets/js/pwa/app.js +42 -4
  94. data/assets/js/pwa/sw.js +46 -44
  95. data/assets/js/pwa/unregister.js +12 -0
  96. metadata +64 -32
  97. data/_config.yml +0 -175
  98. data/_data/contact.yml +0 -30
  99. data/_data/share.yml +0 -27
  100. data/_includes/css-selector.html +0 -15
  101. data/_includes/no-zero-date.html +0 -13
  102. data/_includes/timeago.html +0 -26
  103. data/_plugins/posts-lastmod-hook.rb +0 -14
  104. data/_sass/colors/dark-syntax.scss +0 -87
  105. data/_sass/colors/light-syntax.scss +0 -79
  106. data/_sass/colors/light-typography.scss +0 -81
  107. data/_sass/jekyll-theme-chirpy.scss +0 -24
  108. data/_tabs/about.md +0 -8
  109. data/_tabs/archives.md +0 -7
  110. data/_tabs/categories.md +0 -6
  111. data/_tabs/tags.md +0 -6
  112. data/assets/css/style.scss +0 -12
  113. data/assets/js/dist/pvreport.min.js +0 -6
  114. data/index.html +0 -4
@@ -27,14 +27,6 @@ panel:
27
27
  trending_tags: 热门标签
28
28
  toc: 文章内容
29
29
 
30
- # The liquid date format › http://strftime.net/
31
- date_format:
32
- tooltip: '%F, %R %z'
33
- post:
34
- long: '%F'
35
- short: '%m-%d'
36
- archive_month: '%m月'
37
-
38
30
  copyright:
39
31
  # Shown at the bottom of the post
40
32
  license:
@@ -47,13 +39,14 @@ copyright:
47
39
  verbose: >-
48
40
  除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。
49
41
 
50
- meta: 本站由 :PLATFORM 生成,采用 :THEME 主题。
42
+ meta: 本站采用 :PLATFORM 主题 :THEME
51
43
 
52
44
  not_found:
53
45
  statment: 抱歉,我们放错了该 URL,或者它指向了不存在的内容。
54
- hint_template: :HEAD_BAK尝试再次查找它,或在:ARCHIVES_PAGE上搜索它。
55
- head_back: 返回主页
56
- archives_page: 归档页面
46
+
47
+ notification:
48
+ update_found: 发现新版本的内容。
49
+ update: 更新
57
50
 
58
51
  # ----- Posts related labels -----
59
52
 
@@ -61,11 +54,6 @@ post:
61
54
  written_by: 作者
62
55
  posted: 发表于
63
56
  updated: 更新于
64
- timeago:
65
- day: 天前
66
- hour: 小时前
67
- minute: 分钟前
68
- just_now: 刚刚
69
57
  words: 字
70
58
  pageview_measure: 次浏览
71
59
  read_time:
@@ -79,10 +67,15 @@ post:
79
67
  copy_code:
80
68
  succeed: 已复制!
81
69
  share_link:
82
- title: 分享链接
70
+ title: 分享链接
83
71
  succeed: 链接已复制!
84
- # pinned prompt of posts list on homepage
85
- pin_prompt: 顶置
72
+
73
+ # Date time format.
74
+ # See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
75
+ df:
76
+ post:
77
+ strftime: "%Y/%m/%d"
78
+ dayjs: "YYYY/MM/DD"
86
79
 
87
80
  # categories page
88
81
  categories:
@@ -0,0 +1,83 @@
1
+ # The layout text of site
2
+
3
+ # ----- Commons label -----
4
+
5
+ layout:
6
+ post: 文章
7
+ category: 分類
8
+ tag: 標籤
9
+
10
+ # The tabs of sidebar
11
+ tabs:
12
+ # format: <filename_without_extension>: <value>
13
+ home: 首頁
14
+ categories: 分類
15
+ tags: 標籤
16
+ archives: 封存
17
+ about: 關於
18
+
19
+ # the text displayed in the search bar & search results
20
+ search:
21
+ hint: 搜尋
22
+ cancel: 取消
23
+ no_results: 沒有搜尋結果
24
+
25
+ panel:
26
+ lastmod: 最近更新
27
+ trending_tags: 熱門標籤
28
+ toc: 文章摘要
29
+
30
+ copyright:
31
+ # Shown at the bottom of the post
32
+ license:
33
+ template: 本文章以 :LICENSE_NAME 授權
34
+ name: CC BY 4.0
35
+ link: https://creativecommons.org/licenses/by/4.0/
36
+
37
+ # Displayed in the footer
38
+ brief: 保留部份權利。
39
+ verbose: >-
40
+ 除非另有說明,否則本網誌的文章均由作者按照姓名標示 4.0 國際 (CC BY 4.0) 授權條款進行授權。
41
+
42
+ meta: 本網站使用 :PLATFORM 產生,採用 :THEME 主題
43
+
44
+ not_found:
45
+ statment: 抱歉,您可能正在存取一個已被移動的 URL,或者它從未存在。
46
+
47
+ notification:
48
+ update_found: 發現新版本更新。
49
+ update: 更新
50
+
51
+ # ----- Posts related labels -----
52
+
53
+ post:
54
+ written_by: 作者
55
+ posted: 發布於
56
+ updated: 更新於
57
+ words: 字
58
+ pageview_measure: 次瀏覽
59
+ read_time:
60
+ unit: 分鐘
61
+ prompt: 閱讀
62
+ relate_posts: 相關文章
63
+ share: 分享
64
+ button:
65
+ next: 下一篇
66
+ previous: 上一篇
67
+ copy_code:
68
+ succeed: 已複製!
69
+ share_link:
70
+ title: 分享連結
71
+ succeed: 已複製連結!
72
+
73
+ # Date time format.
74
+ # See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
75
+ df:
76
+ post:
77
+ strftime: "%Y/%m/%d"
78
+ dayjs: "YYYY/MM/DD"
79
+
80
+ # categories page
81
+ categories:
82
+ category_measure: 個分類
83
+ post_measure: 篇文章
@@ -0,0 +1,48 @@
1
+ # fonts
2
+
3
+ webfonts: /assets/lib/fonts/main.css
4
+
5
+ # Libraries
6
+
7
+ jquery:
8
+ js: /assets/lib/jquery/jquery.min.js
9
+
10
+ bootstrap:
11
+ css: /assets/lib/bootstrap/bootstrap.min.css
12
+ js: /assets/lib/bootstrap/bootstrap.bundle.min.js
13
+
14
+ toc:
15
+ css: /assets/lib/tocbot/tocbot.min.css
16
+ js: /assets/lib/tocbot/tocbot.min.js
17
+
18
+ fontawesome:
19
+ css: /assets/lib/fontawesome-free/css/all.min.css
20
+
21
+ search:
22
+ js: /assets/lib/simple-jekyll-search/simple-jekyll-search.min.js
23
+
24
+ mermaid:
25
+ js: /assets/lib/mermaid/mermaid.min.js
26
+
27
+ dayjs:
28
+ js:
29
+ common: /assets/lib/dayjs/dayjs.min.js
30
+ locale: /assets/lib/dayjs/locale/en.min.js
31
+ relativeTime: /assets/lib/dayjs/plugin/relativeTime.min.js
32
+ localizedFormat: /assets/lib/dayjs/plugin/localizedFormat.min.js
33
+
34
+ magnific-popup:
35
+ css: /assets/lib/magnific-popup/magnific-popup.css
36
+ js: /assets/lib/magnific-popup/jquery.magnific-popup.min.js
37
+
38
+ lazysizes:
39
+ js: /assets/lib/lazysizes/lazysizes.min.js
40
+
41
+ clipboard:
42
+ js: /assets/lib/clipboard/clipboard.min.js
43
+
44
+ polyfill:
45
+ js: /assets/lib/polyfill-v3-es6/polyfill.min.js
46
+
47
+ mathjax:
48
+ js: /assets/lib/mathjax/tex-chtml.js
@@ -0,0 +1,59 @@
1
+ # CDNs
2
+
3
+ cdns:
4
+ # Google Fonts
5
+ - url: https://fonts.googleapis.com
6
+ - url: https://fonts.gstatic.com
7
+ args: crossorigin
8
+ - url: https://fonts.googleapis.com
9
+ # jsDelivr CDN
10
+ - url: https://cdn.jsdelivr.net
11
+
12
+ # fonts
13
+
14
+ webfonts: https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;700;900&display=swap
15
+
16
+ # Libraries
17
+
18
+ jquery:
19
+ js: https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
20
+
21
+ bootstrap:
22
+ css: https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css
23
+ js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js
24
+
25
+ toc:
26
+ css: https://cdn.jsdelivr.net/npm/tocbot@4.21.1/dist/tocbot.min.css
27
+ js: https://cdn.jsdelivr.net/npm/tocbot@4.21.1/dist/tocbot.min.js
28
+
29
+ fontawesome:
30
+ css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css
31
+
32
+ search:
33
+ js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
34
+
35
+ mermaid:
36
+ js: https://cdn.jsdelivr.net/npm/mermaid@10.4.0/dist/mermaid.min.js
37
+
38
+ dayjs:
39
+ js:
40
+ common: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/dayjs.min.js
41
+ locale: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/locale/:LOCALE.min.js
42
+ relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/plugin/relativeTime.min.js
43
+ localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/plugin/localizedFormat.min.js
44
+
45
+ magnific-popup:
46
+ css: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/magnific-popup.min.css
47
+ js: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/jquery.magnific-popup.min.js
48
+
49
+ lazysizes:
50
+ js: https://cdn.jsdelivr.net/npm/lazysizes@5.3.2/lazysizes.min.js
51
+
52
+ clipboard:
53
+ js: https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js
54
+
55
+ polyfill:
56
+ js: https://polyfill.io/v3/polyfill.min.js?features=es6
57
+
58
+ mathjax:
59
+ js: https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml.js
@@ -1,54 +1,50 @@
1
- <!--
2
- The Disqus lazy loading.
3
- -->
4
- <div id="disqus_thread" class="pt-2 pb-2">
5
- <p class="text-center text-muted small">
6
- Comments powered by <a href="https://disqus.com/">Disqus</a>.
7
- </p>
1
+ <!-- The Disqus lazy loading. -->
2
+
3
+ <div id="disqus_thread" class="mb-5">
4
+ <p class="text-center text-muted small">Comments powered by <a href="https://disqus.com/">Disqus</a>.</p>
8
5
  </div>
9
6
 
10
7
  <script type="text/javascript">
11
-
12
8
  var disqus_config = function () {
13
9
  this.page.url = '{{ page.url | absolute_url }}';
14
10
  this.page.identifier = '{{ page.url }}';
15
11
  };
16
12
 
17
13
  /* Lazy loading */
18
-
19
- var disqus_observer = new IntersectionObserver(function (entries) {
20
- if(entries[0].isIntersecting) {
14
+ var disqus_observer = new IntersectionObserver(
15
+ function (entries) {
16
+ if (entries[0].isIntersecting) {
21
17
  (function () {
22
- var d = document, s = d.createElement('script');
23
- s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
24
- s.setAttribute('data-timestamp', +new Date());
25
- (d.head || d.body).appendChild(s);
18
+ var d = document,
19
+ s = d.createElement('script');
20
+ s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
21
+ s.setAttribute('data-timestamp', +new Date());
22
+ (d.head || d.body).appendChild(s);
26
23
  })();
27
24
 
28
25
  disqus_observer.disconnect();
29
- }
30
- }, { threshold: [0] });
26
+ }
27
+ },
28
+ { threshold: [0] }
29
+ );
31
30
 
32
31
  disqus_observer.observe(document.querySelector('#disqus_thread'));
33
32
 
34
33
  /* Auto switch theme */
35
-
36
34
  function reloadDisqus() {
37
- /* Disqus hasn't been loaded */
38
- if (typeof DISQUS === "undefined") {
39
- return;
40
- }
41
-
42
- if (document.readyState == 'complete') {
43
- DISQUS.reset({ reload: true, config: disqus_config });
35
+ if (event.source === window && event.data && event.data.direction === ModeToggle.ID) {
36
+ /* Disqus hasn't been loaded */
37
+ if (typeof DISQUS === 'undefined') {
38
+ return;
39
+ }
40
+
41
+ if (document.readyState == 'complete') {
42
+ DISQUS.reset({ reload: true, config: disqus_config });
43
+ }
44
44
  }
45
45
  }
46
46
 
47
- const modeToggle = document.querySelector(".mode-toggle");
48
-
49
- if (typeof modeToggle !== "undefined") {
50
- /* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */
51
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
47
+ if (document.querySelector('.mode-toggle')) {
48
+ window.addEventListener('message', reloadDisqus);
52
49
  }
53
-
54
50
  </script>
@@ -0,0 +1,64 @@
1
+ <!-- https://giscus.app/ -->
2
+ <script type="text/javascript">
3
+ (function () {
4
+ const origin = 'https://giscus.app';
5
+ const iframe = 'iframe.giscus-frame';
6
+ const lightTheme = 'light';
7
+ const darkTheme = 'dark_dimmed';
8
+
9
+ let initTheme = lightTheme;
10
+ const html = document.documentElement;
11
+
12
+ if (
13
+ (html.hasAttribute('data-mode') &&
14
+ html.getAttribute('data-mode') === 'dark') ||
15
+ (!html.hasAttribute('data-mode') &&
16
+ window.matchMedia('(prefers-color-scheme: dark)').matches)
17
+ ) {
18
+ initTheme = darkTheme;
19
+ }
20
+
21
+ let giscusAttributes = {
22
+ src: 'https://giscus.app/client.js',
23
+ 'data-repo': '{{ site.comments.giscus.repo}}',
24
+ 'data-repo-id': '{{ site.comments.giscus.repo_id }}',
25
+ 'data-category': '{{ site.comments.giscus.category }}',
26
+ 'data-category-id': '{{ site.comments.giscus.category_id }}',
27
+ 'data-mapping': '{{ site.comments.giscus.mapping | default: 'pathname' }}',
28
+ 'data-reactions-enabled': '{{ site.comments.giscus.reactions_enabled | default: '1' }}',
29
+ 'data-emit-metadata': '0',
30
+ 'data-theme': initTheme,
31
+ 'data-input-position': '{{ site.comments.giscus.input_position | default: 'bottom' }}',
32
+ 'data-lang': '{{ site.comments.giscus.lang | default: lang }}',
33
+ crossorigin: 'anonymous',
34
+ async: ''
35
+ };
36
+
37
+ let giscusScript = document.createElement('script');
38
+ Object.entries(giscusAttributes).forEach(([key, value]) =>
39
+ giscusScript.setAttribute(key, value)
40
+ );
41
+ document.getElementById('tail-wrapper').appendChild(giscusScript);
42
+
43
+ addEventListener('message', (event) => {
44
+ if (
45
+ event.source === window &&
46
+ event.data &&
47
+ event.data.direction === ModeToggle.ID
48
+ ) {
49
+ /* global theme mode changed */
50
+ const mode = event.data.message;
51
+ const theme = mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme;
52
+
53
+ const message = {
54
+ setConfig: {
55
+ theme: theme
56
+ }
57
+ };
58
+
59
+ const giscus = document.querySelector(iframe).contentWindow;
60
+ giscus.postMessage({ giscus: message }, origin);
61
+ }
62
+ });
63
+ })();
64
+ </script>
@@ -14,8 +14,8 @@
14
14
  const darkTheme = "github-dark";
15
15
  let initTheme = lightTheme;
16
16
 
17
- if ($("html[mode=dark]").length > 0
18
- || ($("html[mode]").length == 0
17
+ if ($("html[data-mode=dark]").length > 0
18
+ || ($("html[data-mode]").length == 0
19
19
  && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
20
20
  initTheme = darkTheme;
21
21
  }
@@ -0,0 +1,20 @@
1
+ <!--
2
+ Date format snippet
3
+ See: ${JS_ROOT}/utils/locale-dateime.js
4
+ -->
5
+
6
+ {% assign df_strftime = site.data.locales[include.lang].df.post.strftime | default: '%d/%m/%Y' %}
7
+ {% assign df_dayjs = site.data.locales[include.lang].df.post.dayjs | default: 'DD/MM/YYYY' %}
8
+
9
+ <time
10
+ {% if include.class %}
11
+ class="{{ include.class }}"
12
+ {% endif %}
13
+ data-ts="{{ include.date | date: '%s' }}"
14
+ data-df="{{ df_dayjs }}"
15
+ {% if include.tooltip %}
16
+ data-bs-toggle="tooltip" data-bs-placement="bottom"
17
+ {% endif %}
18
+ >
19
+ {{ include.date | date: df_strftime }}
20
+ </time>
@@ -0,0 +1,4 @@
1
+ <iframe class="embed-video twitch lazyload"
2
+ src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}"
3
+ frameborder="0" allowfullscreen="true"
4
+ scrolling="no"></iframe>
@@ -0,0 +1,6 @@
1
+ <iframe class="embed-video youtube lazyload"
2
+ src="https://www.youtube.com/embed/{{ include.id }}"
3
+ title="YouTube video player"
4
+ frameborder="0"
5
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
6
+ allowfullscreen></iframe>
@@ -1,37 +1,36 @@
1
- <!--
2
- The Footer
3
- -->
1
+ <!-- The Footer -->
4
2
 
5
- <footer class="d-flex w-100 justify-content-center">
6
- <div class="d-flex justify-content-between align-items-center text-muted">
7
- <div class="footer-left">
8
- <p class="mb-0">
9
- © {{ 'now' | date: "%Y" }}
10
- <a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
11
- {% if site.data.locales[lang].copyright.brief %}
12
- <span data-toggle="tooltip" data-placement="top"
13
- title="{{ site.data.locales[lang].copyright.verbose }}">{{ site.data.locales[lang].copyright.brief }}</span>
14
- {% endif %}
15
- </p>
16
- </div>
3
+ <footer
4
+ aria-label="Site Info"
5
+ class="
6
+ d-flex flex-column justify-content-center text-muted
7
+ flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3
8
+ "
9
+ >
10
+ <p>
11
+ {{ '©' }}
12
+ <time>{{ 'now' | date: '%Y' }}</time>
13
+ <a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
14
+ {% if site.data.locales[include.lang].copyright.brief %}
15
+ <span
16
+ data-bs-toggle="tooltip"
17
+ data-bs-placement="top"
18
+ title="{{ site.data.locales[include.lang].copyright.verbose }}"
19
+ >
20
+ {{- site.data.locales[include.lang].copyright.brief -}}
21
+ </span>
22
+ {% endif %}
23
+ </p>
17
24
 
18
- <div class="footer-right">
19
- <p class="mb-0">
20
- {% capture _platform %}
21
- <a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
22
- {% endcapture %}
25
+ <p>
26
+ {%- capture _platform -%}
27
+ <a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
28
+ {%- endcapture -%}
23
29
 
24
- {% capture _theme %}
25
- <a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
26
- {% endcapture %}
30
+ {%- capture _theme -%}
31
+ <a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
32
+ {%- endcapture -%}
27
33
 
28
- {{ site.data.locales[lang].meta
29
- | default: 'Powered by :PLATFORM with :THEME theme.'
30
- | replace: ':PLATFORM', _platform | replace: ':THEME', _theme
31
- }}
32
-
33
- </p>
34
- </div>
35
-
36
- </div> <!-- div.d-flex -->
34
+ {{ site.data.locales[include.lang].meta | replace: ':PLATFORM', _platform | replace: ':THEME', _theme }}
35
+ </p>
37
36
  </footer>
data/_includes/head.html CHANGED
@@ -1,75 +1,95 @@
1
- <!--
2
- The Head
3
- -->
1
+ <!-- The Head -->
4
2
 
5
3
  <head>
6
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8
-
9
- {% if page.layout == 'home' or page.layout == 'post' %}
10
-
11
- <!-- i18n for `_javascript/utils/timeago.js` -->
12
- <meta name="day-prompt" content="{{ site.data.locales[lang].post.timeago.day }}">
13
- <meta name="hour-prompt" content="{{ site.data.locales[lang].post.timeago.hour }}">
14
- <meta name="minute-prompt" content="{{ site.data.locales[lang].post.timeago.minute }}">
15
- <meta name="justnow-prompt" content="{{ site.data.locales[lang].post.timeago.just_now }}">
16
-
17
- {% if site.google_analytics.pv.proxy_endpoint %}
18
- <meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
19
- {% endif %}
20
-
21
- {% if site.google_analytics.pv.cache_path %}
22
- <meta name="pv-cache-path" content="{{ site.google_analytics.pv.cache_path | relative_url }}">
23
- {% endif %}
24
-
5
+ <meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
6
+ <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1b1b1e">
7
+ <meta name="apple-mobile-web-app-capable" content="yes">
8
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
9
+ <meta
10
+ name="viewport"
11
+ content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
12
+ >
13
+
14
+ {% capture seo_tags %}
15
+ {% seo title=false %}
16
+ {% endcapture %}
17
+
18
+ {% if page.image %}
19
+ {% assign img = page.image.path | default: page.image %}
20
+
21
+ {% unless img contains '://' %}
22
+ {% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
23
+ {% capture target %}"{{ img | absolute_url }}"{% endcapture %}
24
+
25
+ {% if site.img_cdn contains '//' %}
26
+ <!-- it's a cross-origin URL -->
27
+ {% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
28
+ {% else %}
29
+ <!-- it's a local file path -->
30
+ {%- capture replacement -%}
31
+ "{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
32
+ {%- endcapture -%}
33
+ {% endif %}
34
+
35
+ {% assign seo_tags = seo_tags | replace: target, replacement %}
36
+ {% endunless %}
25
37
  {% endif %}
26
38
 
27
- {% seo title=false %}
39
+ {{ seo_tags }}
28
40
 
29
41
  <title>
30
- {%- unless page.layout == "home" -%}
31
- {{ page.title | append: " | "}}
32
- {%- endunless -%}
42
+ {%- unless page.layout == 'home' -%}
43
+ {{ page.title | append: ' | ' }}
44
+ {%- endunless -%}
33
45
  {{ site.title }}
34
46
  </title>
35
47
 
36
- {% include favicons.html %}
48
+ {% include_cached favicons.html %}
49
+
50
+ {% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
51
+ <link href="{{ site.data.origin[type].webfonts | relative_url }}" rel="stylesheet">
37
52
 
38
- <!-- Google Fonts -->
39
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
40
- <link rel="dns-prefetch" href="https://fonts.gstatic.com">
53
+ {% else %}
54
+ {% for cdn in site.data.origin[type].cdns %}
55
+ <link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
56
+ <link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
57
+ {% endfor %}
58
+
59
+ <link rel="stylesheet" href="{{ site.data.origin[type].webfonts | relative_url }}">
60
+ {% endif %}
41
61
 
42
62
  <!-- GA -->
43
- {% if jekyll.environment == 'production' %}
63
+ {% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %}
44
64
  <link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
45
65
  <link rel="dns-prefetch" href="https://www.google-analytics.com">
46
66
 
47
67
  <link rel="preconnect" href="https://www.googletagmanager.com" crossorigin="anonymous">
48
68
  <link rel="dns-prefetch" href="https://www.googletagmanager.com">
49
-
50
- {% if site.google_analytics.pv.proxy_endpoint %}
51
- {% assign proxy_url = site.google_analytics.pv.proxy_endpoint
52
- | replace: "https://", "" | split: "/" | first | prepend: "https://" %}
53
-
54
- <link rel="preconnect" href="{{ proxy_url }}" crossorigin="use-credentials">
55
- <link rel="dns-prefetch" href="{{ proxy_url }}">
56
- {% endif %}
57
69
  {% endif %}
58
70
 
59
- <!-- jsDelivr CDN -->
60
- <link rel="preconnect" href="https://cdn.jsdelivr.net">
61
- <link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
62
-
63
71
  <!-- Bootstrap -->
64
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css">
72
+ <link rel="stylesheet" href="{{ site.data.origin[type].bootstrap.css | relative_url}}">
65
73
 
66
74
  <!-- Font Awesome -->
67
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css">
75
+ <link rel="stylesheet" href="{{ site.data.origin[type].fontawesome.css | relative_url }}">
76
+
77
+ <link rel="stylesheet" href="{{ '/assets/css/:THEME.css' | replace: ':THEME', site.theme | relative_url }}">
68
78
 
69
- {% include css-selector.html %}
79
+ {% if site.toc and page.toc %}
80
+ <link rel="stylesheet" href="{{ site.data.origin[type].toc.css | relative_url }}">
81
+ {% endif %}
82
+
83
+ {% if page.layout == 'page' or page.layout == 'post' %}
84
+ <!-- Manific Popup -->
85
+ <link rel="stylesheet" href="{{ site.data.origin[type].magnific-popup.css | relative_url }}">
86
+ {% endif %}
70
87
 
71
88
  <!-- JavaScript -->
72
89
 
73
- <script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
90
+ {% unless site.theme_mode %}
91
+ {% include mode-toggle.html %}
92
+ {% endunless %}
74
93
 
94
+ {% include metadata-hook.html %}
75
95
  </head>