jekyll-theme-chirpy 4.3.4 → 5.1.0

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -162
  3. data/_config.yml +44 -18
  4. data/_data/assets/cross_origin.yml +62 -0
  5. data/_data/assets/self_host.yml +51 -0
  6. data/_data/locales/en.yml +3 -15
  7. data/_data/locales/id-ID.yml +2 -14
  8. data/_data/locales/ko-KR.yml +78 -0
  9. data/_data/locales/my-MM.yml +78 -0
  10. data/_data/locales/ru-RU.yml +78 -0
  11. data/_data/locales/uk-UA.yml +78 -0
  12. data/_data/locales/zh-CN.yml +2 -14
  13. data/_data/share.yml +1 -1
  14. data/_includes/assets-origin.html +12 -0
  15. data/_includes/{disqus.html → comments/disqus.html} +4 -4
  16. data/_includes/comments/giscus.html +56 -0
  17. data/_includes/comments/utterances.html +51 -0
  18. data/_includes/comments.html +5 -0
  19. data/_includes/footer.html +1 -1
  20. data/_includes/head.html +35 -20
  21. data/_includes/js-selector.html +43 -11
  22. data/_includes/jsdelivr-combine.html +32 -0
  23. data/_includes/mermaid.html +31 -3
  24. data/_includes/mode-toggle.html +49 -65
  25. data/_includes/post-sharing.html +2 -2
  26. data/_includes/read-time.html +3 -3
  27. data/_includes/refactor-content.html +160 -36
  28. data/_includes/related-posts.html +1 -1
  29. data/_includes/search-loader.html +1 -1
  30. data/_includes/search-results.html +0 -8
  31. data/_includes/sidebar.html +16 -17
  32. data/_includes/timeago.html +11 -23
  33. data/_includes/toc.html +16 -0
  34. data/_includes/topbar.html +2 -3
  35. data/_includes/trending-tags.html +14 -0
  36. data/_includes/update-list.html +16 -0
  37. data/_layouts/archives.html +5 -7
  38. data/_layouts/category.html +3 -5
  39. data/_layouts/default.html +10 -4
  40. data/_layouts/home.html +14 -11
  41. data/_layouts/page.html +47 -22
  42. data/_layouts/post.html +128 -127
  43. data/_layouts/tag.html +3 -5
  44. data/_sass/addon/commons.scss +276 -290
  45. data/_sass/addon/module.scss +67 -31
  46. data/_sass/addon/syntax.scss +90 -66
  47. data/_sass/addon/variables.scss +7 -7
  48. data/_sass/colors/dark-syntax.scss +4 -4
  49. data/_sass/colors/dark-typography.scss +21 -9
  50. data/_sass/colors/light-syntax.scss +9 -4
  51. data/_sass/colors/light-typography.scss +18 -6
  52. data/_sass/jekyll-theme-chirpy.scss +1 -1
  53. data/_sass/layout/home.scss +6 -2
  54. data/_sass/layout/post.scss +52 -46
  55. data/_tabs/about.md +2 -2
  56. data/assets/404.html +0 -2
  57. data/assets/js/data/search.json +1 -0
  58. data/assets/js/data/swcache.js +11 -20
  59. data/assets/js/dist/categories.min.js +2 -2
  60. data/assets/js/dist/commons.min.js +2 -2
  61. data/assets/js/dist/home.min.js +2 -2
  62. data/assets/js/dist/misc.min.js +6 -0
  63. data/assets/js/dist/page.min.js +2 -2
  64. data/assets/js/dist/post.min.js +2 -2
  65. data/assets/js/dist/pvreport.min.js +2 -2
  66. metadata +16 -6
  67. data/_includes/css-selector.html +0 -15
  68. data/_includes/no-zero-date.html +0 -13
  69. data/_includes/panel.html +0 -59
@@ -0,0 +1,78 @@
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
+ အခြားမှတ်သားထားချက်များမှလွဲ၍ ဤဆိုက်ရှိ ဘလော့ဂ်ပို့စ်များသည် စာရေးသူ၏
41
+ Creative Commons Attribution 4.0 International (CC BY 4.0) အောက်တွင် လိုင်စင်ရထားပါသည်။
42
+
43
+ meta: Powered by :PLATFORM with :THEME theme.
44
+
45
+ not_found:
46
+ statment: ဝမ်းနည်းပါသည်၊ ကျွန်ုပ်တို့သည် အဆိုပါ URL ကို မှားယွင်းစွာ နေရာချထားခြင်း သို့မဟုတ် ၎င်းသည် မရှိသောအရာကို ညွှန်ပြနေပါသည်။
47
+ hint_template: ၎င်းကို ထပ်မံရှာဖွေရန် :HEAD_BAK , သို့မဟုတ် :ARCHIVES_PAGE တွင်ရှာပါ။
48
+ head_back: အဓိကစာမျက်နှာသို့ပြန်သွားပါ။
49
+ archives_page: မှတ်တမ်း​တိုက် စာမျက်နှာ။
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
+ # pinned prompt of posts list on homepage
73
+ pin_prompt: ချိတ်ထားသည်။
74
+
75
+ # categories page
76
+ categories:
77
+ category_measure: ကဏ္ဍများ
78
+ post_measure: ပို့စ်များ
@@ -0,0 +1,78 @@
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
+ Публикации на сайте защищены лицензией Creative Commons Attribution 4.0 International (CC BY 4.0),
41
+ если в тексте публикации не указано иное.
42
+
43
+ meta: Powered by :PLATFORM with :THEME theme.
44
+
45
+ not_found:
46
+ statment: Извините, эта ссылка указывает на ресурс который не существует.
47
+ hint_template: :HEAD_BAK чтобы снова осуществить поиск, или поищите :ARCHIVES_PAGE.
48
+ head_back: Вернитесь на домашнюю страницу
49
+ archives_page: архиве
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
+ # pinned prompt of posts list on homepage
73
+ pin_prompt: Закреплено
74
+
75
+ # categories page
76
+ categories:
77
+ category_measure: категории
78
+ post_measure: публикации
@@ -0,0 +1,78 @@
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
+ Публікації на сайті захищено ліцензією Creative Commons Attribution 4.0 International (CC BY 4.0),
41
+ якщо інше не вказано в тексті.
42
+
43
+ meta: Powered by :PLATFORM with :THEME theme.
44
+
45
+ not_found:
46
+ statment: Вибачте, це посилання вказує на ресурс, що не існує.
47
+ hint_template: :HEAD_BAK аби здійснити пошук, або пошукайте в :ARCHIVES_PAGE.
48
+ head_back: Поверніться на домашню сторінку
49
+ archives_page: архіві
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
+ # pinned prompt of posts list on homepage
73
+ pin_prompt: Закріплено
74
+
75
+ # categories page
76
+ categories:
77
+ category_measure: категорії
78
+ post_measure: публікації
@@ -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:
@@ -58,13 +50,9 @@ not_found:
58
50
  # ----- Posts related labels -----
59
51
 
60
52
  post:
61
- published: 发表于
53
+ written_by: 作者
54
+ posted: 发表于
62
55
  updated: 更新于
63
- timeago:
64
- day: 天前
65
- hour: 小时前
66
- minute: 分钟前
67
- just_now: 刚刚
68
56
  words: 字
69
57
  pageview_measure: 次浏览
70
58
  read_time:
data/_data/share.yml CHANGED
@@ -13,7 +13,7 @@ platforms:
13
13
  -
14
14
  type: Telegram
15
15
  icon: "fab fa-telegram"
16
- link: "https://telegram.me/share?text=TITLE&url=URL"
16
+ link: "https://t.me/share/url?url=URL&text=TITLE"
17
17
 
18
18
  # Uncomment below if you need to.
19
19
  # -
@@ -0,0 +1,12 @@
1
+ {% comment %} Site static assets origin {% endcomment %}
2
+ {% assign origin = 'cross_origin' %}
3
+
4
+ {% if site.assets.self_host.enabled %}
5
+ {% if site.assets.self_host.env %}
6
+ {% if site.assets.self_host.env == jekyll.environment %}
7
+ {% assign origin = 'self_host' %}
8
+ {% endif %}
9
+ {% else %}
10
+ {% assign origin = 'self_host' %}
11
+ {% endif %}
12
+ {% endif %}
@@ -1,7 +1,6 @@
1
1
  <!--
2
2
  The Disqus lazy loading.
3
3
  -->
4
-
5
4
  <div id="disqus_thread" class="pt-2 pb-2">
6
5
  <p class="text-center text-muted small">
7
6
  Comments powered by <a href="https://disqus.com/">Disqus</a>.
@@ -9,6 +8,7 @@
9
8
  </div>
10
9
 
11
10
  <script type="text/javascript">
11
+
12
12
  var disqus_config = function () {
13
13
  this.page.url = '{{ page.url | absolute_url }}';
14
14
  this.page.identifier = '{{ page.url }}';
@@ -20,7 +20,7 @@
20
20
  if(entries[0].isIntersecting) {
21
21
  (function () {
22
22
  var d = document, s = d.createElement('script');
23
- s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
23
+ s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
24
24
  s.setAttribute('data-timestamp', +new Date());
25
25
  (d.head || d.body).appendChild(s);
26
26
  })();
@@ -46,8 +46,8 @@
46
46
 
47
47
  const modeToggle = document.querySelector(".mode-toggle");
48
48
 
49
- if (modeToggle !== null) {
50
- modeToggle.addEventListener('click', reloadDisqus);
49
+ if (typeof modeToggle !== "undefined") {
50
+ /* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */
51
51
  window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
52
52
  }
53
53
 
@@ -0,0 +1,56 @@
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
+ let initTheme = lightTheme;
9
+
10
+ if ($("html[data-mode=dark]").length > 0
11
+ || ($("html[data-mode]").length == 0
12
+ && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
13
+ initTheme = darkTheme;
14
+ }
15
+
16
+ let giscusAttributes = {
17
+ "src": "https://giscus.app/client.js",
18
+ "data-repo": "{{ site.comments.giscus.repo}}",
19
+ "data-repo-id": "{{ site.comments.giscus.repo_id }}",
20
+ "data-category": "{{ site.comments.giscus.category }}",
21
+ "data-category-id": "{{ site.comments.giscus.category_id }}",
22
+ "data-mapping": "{{ site.comments.giscus.mapping | default: 'pathname' }}",
23
+ "data-reactions-enabled": "1",
24
+ "data-emit-metadata": "0",
25
+ "data-theme": initTheme,
26
+ "data-input-position": "{{ site.comments.giscus.input_position | default: 'bottom' }}",
27
+ "data-lang": "{{ site.comments.giscus.lang | default: lang }}",
28
+ "crossorigin": "anonymous",
29
+ "async": ""
30
+ };
31
+
32
+ let giscusScript = document.createElement("script");
33
+ Object.entries(giscusAttributes).forEach(([key, value]) => giscusScript.setAttribute(key, value));
34
+ document.getElementById("tail-wrapper").appendChild(giscusScript);
35
+
36
+ addEventListener("message", (event) => {
37
+ if (event.source === window && event.data &&
38
+ event.data.direction === ModeToggle.ID) {
39
+ /* global theme mode changed */
40
+ const mode = event.data.message;
41
+ const theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
42
+
43
+ const message = {
44
+ setConfig: {
45
+ theme: theme
46
+ }
47
+ };
48
+
49
+ const giscus = document.querySelector(iframe).contentWindow;
50
+ giscus.postMessage({ giscus: message }, origin);
51
+ }
52
+
53
+ });
54
+
55
+ });
56
+ </script>
@@ -0,0 +1,51 @@
1
+ <!-- https://utteranc.es/ -->
2
+ <script src="https://utteranc.es/client.js"
3
+ repo="{{ site.comments.utterances.repo }}"
4
+ issue-term="{{ site.comments.utterances.issue_term }}"
5
+ crossorigin="anonymous"
6
+ async>
7
+ </script>
8
+
9
+ <script type="text/javascript">
10
+ $(function() {
11
+ const origin = "https://utteranc.es";
12
+ const iframe = "iframe.utterances-frame";
13
+ const lightTheme = "github-light";
14
+ const darkTheme = "github-dark";
15
+ let initTheme = lightTheme;
16
+
17
+ if ($("html[data-mode=dark]").length > 0
18
+ || ($("html[data-mode]").length == 0
19
+ && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
20
+ initTheme = darkTheme;
21
+ }
22
+
23
+ addEventListener("message", (event) => {
24
+ let theme;
25
+
26
+ /* credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> */
27
+ if (event.origin === origin) {
28
+ /* page initial */
29
+ theme = initTheme;
30
+
31
+ } else if (event.source === window && event.data &&
32
+ event.data.direction === ModeToggle.ID) {
33
+ /* global theme mode changed */
34
+ const mode = event.data.message;
35
+ theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
36
+
37
+ } else {
38
+ return;
39
+ }
40
+
41
+ const message = {
42
+ type: "set-theme",
43
+ theme: theme
44
+ };
45
+
46
+ const utterances = document.querySelector(iframe).contentWindow;
47
+ utterances.postMessage(message, origin);
48
+ });
49
+
50
+ });
51
+ </script>
@@ -0,0 +1,5 @@
1
+ <!-- The comments switcher -->
2
+ {% if page.comments and site.comments.active %}
3
+ {% capture path %}comments/{{ site.comments.active }}.html{% endcapture %}
4
+ {% include {{ path }} %}
5
+ {% endif %}
@@ -3,7 +3,7 @@
3
3
  -->
4
4
 
5
5
  <footer class="d-flex w-100 justify-content-center">
6
- <div class="d-flex justify-content-between align-items-center">
6
+ <div class="d-flex justify-content-between align-items-center text-muted">
7
7
  <div class="footer-left">
8
8
  <p class="mb-0">
9
9
  © {{ 'now' | date: "%Y" }}
data/_includes/head.html CHANGED
@@ -6,13 +6,12 @@
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8
8
 
9
- {% if page.layout == 'home' or page.layout == 'post' %}
9
+ <!-- Allow having a localized datetime different from the appearance language -->
10
+ {% if site.prefer_datetime_locale %}
11
+ <meta name="prefer-datetime-locale" content="{{ site.prefer_datetime_locale }}">
12
+ {% endif %}
10
13
 
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 }}">
14
+ {% if page.layout == 'home' or page.layout == 'post' %}
16
15
 
17
16
  {% if site.google_analytics.pv.proxy_endpoint %}
18
17
  <meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
@@ -35,12 +34,24 @@
35
34
 
36
35
  {% include favicons.html %}
37
36
 
38
- <!-- Google Fonts -->
39
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
40
- <link rel="dns-prefetch" href="https://fonts.gstatic.com">
37
+ {% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
38
+
39
+ <link href="{{ site.data.assets[origin].webfonts | relative_url }}" rel="stylesheet">
40
+
41
+ {% else %}
42
+
43
+ {% for cdn in site.data.assets[origin].cdns %}
44
+ <link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
45
+ <link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
46
+ {% endfor %}
47
+
48
+ <link rel="stylesheet" href="{{ site.data.assets[origin].webfonts }}">
49
+
50
+ {% endif %}
41
51
 
42
52
  <!-- GA -->
43
- {% if jekyll.environment == 'production' %}
53
+ {% if jekyll.environment == 'production'
54
+ and site.google_analytics.id != empty and site.google_analytics.id %}
44
55
  <link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
45
56
  <link rel="dns-prefetch" href="https://www.google-analytics.com">
46
57
 
@@ -49,27 +60,31 @@
49
60
 
50
61
  {% if site.google_analytics.pv.proxy_endpoint %}
51
62
  {% assign proxy_url = site.google_analytics.pv.proxy_endpoint
52
- | replace: "https://", "" | split: "/" | first | prepend: "https://" %}
53
-
63
+ | replace: "https://", "" | split: "/" | first | prepend: "https://" %}
54
64
  <link rel="preconnect" href="{{ proxy_url }}" crossorigin="use-credentials">
55
65
  <link rel="dns-prefetch" href="{{ proxy_url }}">
56
66
  {% endif %}
57
67
  {% endif %}
58
68
 
59
- <!-- jsDelivr CDN -->
60
- <link rel="preconnect" href="https://cdn.jsdelivr.net">
61
- <link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
62
-
63
69
  <!-- Bootstrap -->
64
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css">
70
+ <link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap.css }}">
65
71
 
66
72
  <!-- Font Awesome -->
67
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css">
73
+ <link rel="stylesheet" href="{{ site.data.assets[origin].fontawesome.css }}">
74
+
75
+ <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
68
76
 
69
- {% include css-selector.html %}
77
+ {% if site.toc and page.toc %}
78
+ <link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap-toc.css }}">
79
+ {% endif %}
80
+
81
+ {% if page.layout == 'page' or page.layout == 'post' %}
82
+ <!-- Manific Popup -->
83
+ <link rel="stylesheet" href="{{ site.data.assets[origin].magnific-popup.css }}">
84
+ {% endif %}
70
85
 
71
86
  <!-- JavaScript -->
72
87
 
73
- <script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
88
+ <script src="{{ site.data.assets[origin].jquery.js }}"></script>
74
89
 
75
90
  </head>
@@ -4,17 +4,46 @@
4
4
 
5
5
  <!-- layout specified -->
6
6
 
7
- {% if page.layout == 'home' or page.layout == 'post' %}
7
+ {% if page.layout == 'post' %}
8
8
  {% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
9
9
  <!-- pv-report needs countup.js -->
10
- <script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
10
+ <script async src="{{ site.data.assets[origin].countup.js }}"></script>
11
11
  <script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
12
12
  {% endif %}
13
13
  {% endif %}
14
14
 
15
15
  {% if page.layout == 'post' or page.layout == 'page' %}
16
- <!-- image lazy-loading & popup -->
17
- <script src="https://cdn.jsdelivr.net/combine/npm/lozad/dist/lozad.min.js,npm/magnific-popup@1/dist/jquery.magnific-popup.min.js,npm/clipboard@2/dist/clipboard.min.js"></script>
16
+ <!-- image lazy-loading & popup & clipboard -->
17
+ {% assign _urls = site.data.assets[origin].magnific-popup.js
18
+ | append: ',' | append: site.data.assets[origin].lozad.js
19
+ | append: ',' | append: site.data.assets[origin].clipboard.js
20
+ %}
21
+
22
+ {% include jsdelivr-combine.html urls=_urls %}
23
+
24
+ {% endif %}
25
+
26
+ {% if page.layout == 'home'
27
+ or page.layout == 'post'
28
+ or page.layout == 'archives'
29
+ or page.layout == 'category'
30
+ or page.layout == 'tag' %}
31
+
32
+ {% if site.prefer_datetime_locale %}
33
+ {% assign locale = site.prefer_datetime_locale | downcase %}
34
+ {% else %}
35
+ {% assign locale = site.lang | split: '-' | first %}
36
+ {% endif %}
37
+
38
+ {% assign _urls = site.data.assets[origin].dayjs.js.common
39
+ | append: ',' | append: site.data.assets[origin].dayjs.js.locale
40
+ | replace: ':LOCALE', locale
41
+ | append: ',' | append: site.data.assets[origin].dayjs.js.relativeTime
42
+ | append: ',' | append: site.data.assets[origin].dayjs.js.localizedFormat
43
+ %}
44
+
45
+ {% include jsdelivr-combine.html urls=_urls %}
46
+
18
47
  {% endif %}
19
48
 
20
49
  {% if page.layout == 'home'
@@ -22,12 +51,16 @@
22
51
  or page.layout == 'post'
23
52
  or page.layout == 'page' %}
24
53
  {% assign type = page.layout %}
54
+ {% elsif page.layout == 'archives'
55
+ or page.layout == 'category'
56
+ or page.layout == 'tag' %}
57
+ {% assign type = "misc" %}
25
58
  {% else %}
26
59
  {% assign type = "commons" %}
27
60
  {% endif %}
28
61
 
29
- {% assign js = type | prepend: '/assets/js/dist/' | append: '.min.js' %}
30
- <script defer src="{{ js | relative_url }}"></script>
62
+ {% capture script %}/assets/js/dist/{{ type }}.min.js{% endcapture %}
63
+ <script defer src="{{ script | relative_url }}"></script>
31
64
 
32
65
  {% if page.math %}
33
66
  <!-- MathJax -->
@@ -46,22 +79,21 @@
46
79
  }
47
80
  };
48
81
  </script>
49
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
50
- <script type="text/javascript" id="MathJax-script" async
51
- src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
82
+ <script src="{{ site.data.assets[origin].polyfill.js }}"></script>
83
+ <script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js }}">
52
84
  </script>
53
85
  {% endif %}
54
86
 
55
87
  <!-- commons -->
56
88
 
57
- <script src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.16.1,npm/bootstrap@4/dist/js/bootstrap.min.js"></script>
89
+ <script src="{{ site.data.assets[origin].bootstrap.js }}"></script>
58
90
 
59
91
  {% if jekyll.environment == 'production' %}
60
92
  <!-- PWA -->
61
93
  <script defer src="{{ '/app.js' | relative_url }}"></script>
62
94
 
63
95
  <!-- GA -->
64
- {% if site.google_analytics.id %}
96
+ {% if site.google_analytics.id != empty and site.google_analytics.id %}
65
97
  {% include google-analytics.html %}
66
98
  {% endif %}
67
99
 
@@ -0,0 +1,32 @@
1
+ {% assign urls = include.urls | split: ',' %}
2
+
3
+ {% assign combined_urls = nil %}
4
+
5
+ {% assign domain = 'https://cdn.jsdelivr.net/' %}
6
+
7
+ {% for url in urls %}
8
+
9
+ {% if url contains domain %}
10
+ {% assign url_snippet = url | slice: domain.size, url.size %}
11
+
12
+ {% if combined_urls %}
13
+ {% assign combined_urls = combined_urls | append: ',' | append: url_snippet %}
14
+ {% else %}
15
+ {% assign combined_urls = domain | append: 'combine/' | append: url_snippet %}
16
+ {% endif %}
17
+
18
+ {% elsif url contains '//' %}
19
+
20
+ <script src="{{ url }}"></script>
21
+
22
+ {% else %}
23
+
24
+ <script src="{{ url | relative_url }}"></script>
25
+
26
+ {% endif %}
27
+
28
+ {% endfor %}
29
+
30
+ {% if combined_urls %}
31
+ <script src="{{ combined_urls }}"></script>
32
+ {% endif %}