jekyll-theme-purple 1.0.4 → 1.0.5

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/_data/locales/ar.yml +7 -1
  3. data/_data/locales/bg-BG.yml +7 -1
  4. data/_data/locales/ca-ES.yml +7 -1
  5. data/_data/locales/cs-CZ.yml +7 -1
  6. data/_data/locales/da-DK.yml +7 -1
  7. data/_data/locales/de-DE.yml +7 -1
  8. data/_data/locales/dv/342/200/221MV.yml +7 -1
  9. data/_data/locales/el-GR.yml +7 -1
  10. data/_data/locales/en.yml +7 -1
  11. data/_data/locales/es-ES.yml +7 -1
  12. data/_data/locales/fa-IR.yml +7 -1
  13. data/_data/locales/fi-FI.yml +7 -1
  14. data/_data/locales/fr-FR.yml +7 -1
  15. data/_data/locales/hu-HU.yml +7 -1
  16. data/_data/locales/id-ID.yml +7 -1
  17. data/_data/locales/it-IT.yml +7 -1
  18. data/_data/locales/ja-JP.yml +7 -1
  19. data/_data/locales/ko-KR.yml +7 -1
  20. data/_data/locales/ku-IQ.yml +7 -1
  21. data/_data/locales/my-MM.yml +7 -1
  22. data/_data/locales/nl-NL.yml +7 -1
  23. data/_data/locales/ps/342/200/221AF.yml +7 -1
  24. data/_data/locales/pt-BR.yml +7 -1
  25. data/_data/locales/ru-RU.yml +7 -1
  26. data/_data/locales/sl-SI.yml +7 -1
  27. data/_data/locales/sv-SE.yml +7 -1
  28. data/_data/locales/th.yml +7 -1
  29. data/_data/locales/tr-TR.yml +7 -1
  30. data/_data/locales/uk-UA.yml +7 -1
  31. data/_data/locales/ur-PK.yml +7 -1
  32. data/_data/locales/vi-VN.yml +7 -1
  33. data/_data/locales/zh-CN.yml +7 -1
  34. data/_data/locales/zh-TW.yml +7 -1
  35. data/_data/origin/cors.yml +18 -15
  36. data/_includes/comments/disqus.html +2 -2
  37. data/_includes/comments/giscus.html +17 -7
  38. data/_includes/comments/utterances.html +4 -4
  39. data/_includes/datetime.html +1 -1
  40. data/_includes/head.html +16 -5
  41. data/_includes/js-selector.html +0 -1
  42. data/_includes/language-alias.html +7 -9
  43. data/_includes/media-url.html +1 -1
  44. data/_includes/notification.html +13 -9
  45. data/_includes/post-edit.html +23 -0
  46. data/_includes/post-paginator.html +1 -1
  47. data/_includes/refactor-content.html +1 -1
  48. data/_includes/sidebar.html +48 -6
  49. data/_layouts/default.html +7 -6
  50. data/_layouts/post.html +16 -13
  51. data/_sass/abstracts/_mixins.scss +6 -0
  52. data/_sass/abstracts/_variables.scss +6 -0
  53. data/_sass/base/_base.scss +28 -20
  54. data/_sass/base/_syntax.scss +7 -4
  55. data/_sass/components/_popups.scss +17 -28
  56. data/_sass/layout/_sidebar.scss +97 -9
  57. data/_sass/pages/_archives.scss +1 -1
  58. data/_sass/pages/_post.scss +11 -1
  59. data/_sass/themes/_dark.scss +5 -0
  60. data/_sass/themes/_light.scss +5 -0
  61. data/assets/css/jekyll-theme-purple.scss +4 -0
  62. data/assets/img/favicons/site.webmanifest +1 -1
  63. metadata +2 -10
  64. data/assets/js/dist/app.min.js +0 -7
  65. data/assets/js/dist/categories.min.js +0 -4
  66. data/assets/js/dist/commons.min.js +0 -4
  67. data/assets/js/dist/home.min.js +0 -4
  68. data/assets/js/dist/misc.min.js +0 -4
  69. data/assets/js/dist/page.min.js +0 -4
  70. data/assets/js/dist/post.min.js +0 -4
  71. data/assets/js/dist/sw.min.js +0 -7
  72. data/assets/js/dist/theme.min.js +0 -4
@@ -46,9 +46,14 @@ not_found:
46
46
  statement: Üzgünüz, bu linki yanlış yerleştirdik veya var olmayan bir şeye işaret ediyor.
47
47
 
48
48
  notification:
49
- update_found: İçeriğin yeni bir sürümü mevcut.
49
+ update_found: Yeni içerik bulundu
50
50
  update: Güncelle
51
51
 
52
+ theme:
53
+ light: Açık
54
+ dark: Koyu
55
+ system: Sistem
56
+
52
57
  # ----- Posts related labels -----
53
58
 
54
59
  post:
@@ -60,6 +65,7 @@ post:
60
65
  read_time:
61
66
  unit: dakikada
62
67
  prompt: okunabilir
68
+ edit: Bu gönderiyi düzenle
63
69
  relate_posts: Benzer Gönderiler
64
70
  share: Paylaş
65
71
  button:
@@ -46,9 +46,14 @@ not_found:
46
46
  statement: Вибачте, це посилання вказує на ресурс, що не існує.
47
47
 
48
48
  notification:
49
- update_found: Доступна нова версія вмісту.
49
+ update_found: Знайдено новий вміст
50
50
  update: Оновлення
51
51
 
52
+ theme:
53
+ light: Світла
54
+ dark: Темна
55
+ system: Системна
56
+
52
57
  # ----- Posts related labels -----
53
58
 
54
59
  post:
@@ -60,6 +65,7 @@ post:
60
65
  read_time:
61
66
  unit: хвилин
62
67
  prompt: читання
68
+ edit: Редагувати цей пост
63
69
  relate_posts: Вас також може зацікавити
64
70
  share: Поділитися
65
71
  button:
@@ -46,9 +46,14 @@ not_found:
46
46
  statement: معذرت، یہ URL غلط ہے یا جس چیز کی طرف اشارہ کر رہا ہے وہ موجود نہیں۔
47
47
 
48
48
  notification:
49
- update_found: نیا مواد دستیاب ہے۔
49
+ update_found: نیا مواد مل گیا
50
50
  update: اپ ڈیٹ
51
51
 
52
+ theme:
53
+ light: روشن
54
+ dark: تاریک
55
+ system: سسٹم
56
+
52
57
  # ----- Posts related labels -----
53
58
 
54
59
  post:
@@ -60,6 +65,7 @@ post:
60
65
  read_time:
61
66
  unit: منٹ
62
67
  prompt: پڑھیں
68
+ edit: اس تحریر میں ترمیم کریں
63
69
  relate_posts: مزید مطالعہ
64
70
  share: شیئر
65
71
  button:
@@ -45,9 +45,14 @@ not_found:
45
45
  statement: Xin lỗi, chúng tôi đã đặt nhầm URL hoặc đường dẫn trỏ đến một trang nào đó không tồn tại.
46
46
 
47
47
  notification:
48
- update_found: Đã phiên bản mới của nội dung.
48
+ update_found: Đã tìm thấy nội dung mới
49
49
  update: Cập nhật
50
50
 
51
+ theme:
52
+ light: Sáng
53
+ dark: Tối
54
+ system: Hệ thống
55
+
51
56
  # ----- Posts related labels -----
52
57
 
53
58
  post:
@@ -59,6 +64,7 @@ post:
59
64
  read_time:
60
65
  unit: phút
61
66
  prompt: đọc
67
+ edit: Chỉnh sửa bài viết này
62
68
  relate_posts: Bài viết liên quan
63
69
  share: Chia sẻ
64
70
  button:
@@ -45,9 +45,14 @@ not_found:
45
45
  statement: 抱歉,我们放错了该 URL,或者它指向了不存在的内容。
46
46
 
47
47
  notification:
48
- update_found: 发现新版本的内容。
48
+ update_found: 发现新内容
49
49
  update: 更新
50
50
 
51
+ theme:
52
+ light: 浅色
53
+ dark: 深色
54
+ system: 跟随系统
55
+
51
56
  # ----- Posts related labels -----
52
57
 
53
58
  post:
@@ -59,6 +64,7 @@ post:
59
64
  read_time:
60
65
  unit: 分钟
61
66
  prompt: 阅读
67
+ edit: 编辑此文
62
68
  relate_posts: 相关文章
63
69
  share: 分享
64
70
  button:
@@ -45,9 +45,14 @@ not_found:
45
45
  statement: 抱歉,您可能正在存取一個已被移動的 URL,或者它從未存在。
46
46
 
47
47
  notification:
48
- update_found: 發現新版本更新。
48
+ update_found: 發現新內容
49
49
  update: 更新
50
50
 
51
+ theme:
52
+ light: 淺色
53
+ dark: 深色
54
+ system: 跟隨系統
55
+
51
56
  # ----- Posts related labels -----
52
57
 
53
58
  post:
@@ -59,6 +64,7 @@ post:
59
64
  read_time:
60
65
  unit: 分鐘
61
66
  prompt: 閱讀
67
+ edit: 編輯此文
62
68
  relate_posts: 相關文章
63
69
  share: 分享
64
70
  button:
@@ -19,36 +19,39 @@ webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Sour
19
19
 
20
20
  # Libraries
21
21
 
22
+ bootstrap:
23
+ css: https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css
24
+
22
25
  toc:
23
- css: https://cdn.jsdelivr.net/npm/tocbot@4.36.4/dist/tocbot.min.css
24
- js: https://cdn.jsdelivr.net/npm/tocbot@4.36.4/dist/tocbot.min.js
26
+ css: https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.css
27
+ js: https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js
25
28
 
26
29
  fontawesome:
27
- css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@7.1.0/css/all.min.css
30
+ css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@7/css/all.min.css
28
31
 
29
32
  search:
30
- js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
33
+ js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1/dest/simple-jekyll-search.min.js
31
34
 
32
35
  mermaid:
33
- js: https://cdn.jsdelivr.net/npm/mermaid@11.12.0/dist/mermaid.min.js
36
+ js: https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js
34
37
 
35
38
  dayjs:
36
39
  js:
37
- common: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/dayjs.min.js
38
- locale: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/locale/:LOCALE.js
39
- relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/plugin/relativeTime.js
40
- localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/plugin/localizedFormat.js
40
+ common: https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js
41
+ locale: https://cdn.jsdelivr.net/npm/dayjs@1/locale/:LOCALE.js
42
+ relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1/plugin/relativeTime.js
43
+ localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1/plugin/localizedFormat.js
41
44
 
42
45
  glightbox:
43
- css: https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css
44
- js: https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js
46
+ css: https://cdn.jsdelivr.net/npm/glightbox@3/dist/css/glightbox.min.css
47
+ js: https://cdn.jsdelivr.net/npm/glightbox@3/dist/js/glightbox.min.js
45
48
 
46
49
  lazy-polyfill:
47
- css: https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@2.1.1/dist/loading-attribute-polyfill.min.css
48
- js: https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@2.1.1/dist/loading-attribute-polyfill.umd.min.js
50
+ css: https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@2/dist/loading-attribute-polyfill.min.css
51
+ js: https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@2/dist/loading-attribute-polyfill.umd.min.js
49
52
 
50
53
  clipboard:
51
- js: https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js
54
+ js: https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js
52
55
 
53
56
  mathjax:
54
- js: https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml.js
57
+ js: https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js
@@ -19,7 +19,7 @@
19
19
 
20
20
  {%- comment -%} Auto switch theme {%- endcomment -%}
21
21
  function reloadDisqus(event) {
22
- if (event.source === window && event.data && event.data.id === Theme.ID) {
22
+ if (event.source === window && event.data && event.data.id === Theme.eventId) {
23
23
  {%- comment -%} Disqus hasn't been loaded {%- endcomment -%}
24
24
  if (typeof DISQUS === 'undefined') {
25
25
  return;
@@ -33,7 +33,7 @@
33
33
 
34
34
  addDisqus();
35
35
 
36
- if (Theme.switchable) {
36
+ if (Theme.isToggleable) {
37
37
  addEventListener('message', reloadDisqus);
38
38
  }
39
39
 
@@ -1,8 +1,8 @@
1
1
  <!-- https://giscus.app/ -->
2
2
  <script>
3
3
  (function () {
4
- const themeMapper = Theme.getThemeMapper('light', 'dark_dimmed');
5
- const initTheme = themeMapper[Theme.visualState];
4
+ const themeMap = Theme.newThemeMap('light', 'dark_dimmed');
5
+ const initTheme = themeMap[Theme.resolvedTheme];
6
6
 
7
7
  let lang = '{{ site.comments.giscus.lang | default: lang }}';
8
8
  {%- comment -%} https://github.com/giscus/giscus/tree/main/locales {%- endcomment -%}
@@ -37,8 +37,8 @@
37
37
  $footer.insertAdjacentElement("beforebegin", giscusNode);
38
38
 
39
39
  addEventListener('message', (event) => {
40
- if (event.source === window && event.data && event.data.id === Theme.ID) {
41
- const newTheme = themeMapper[Theme.visualState];
40
+ if (event.source === window && event.data && event.data.id === Theme.eventId) {
41
+ const newTheme = themeMap[Theme.resolvedTheme];
42
42
 
43
43
  const message = {
44
44
  setConfig: {
@@ -46,9 +46,19 @@
46
46
  }
47
47
  };
48
48
 
49
- const giscus =
50
- document.getElementsByClassName('giscus-frame')[0].contentWindow;
51
- giscus.postMessage({ giscus: message }, 'https://giscus.app');
49
+ const iframe = document.querySelector('.giscus-frame');
50
+
51
+ if (!iframe) {
52
+ return;
53
+ }
54
+
55
+ if (iframe.classList.contains('giscus-frame--loading')) {
56
+ let url = new URL(iframe.src);
57
+ url.searchParams.set('theme', newTheme);
58
+ iframe.src = url.toString();
59
+ }
60
+
61
+ iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
52
62
  }
53
63
  });
54
64
  })();
@@ -2,8 +2,8 @@
2
2
  <script>
3
3
  (function () {
4
4
  const origin = 'https://utteranc.es';
5
- const themeMapper = Theme.getThemeMapper('github-light', 'github-dark');
6
- const initTheme = themeMapper[Theme.visualState];
5
+ const themeMap = Theme.newThemeMap('github-light', 'github-dark');
6
+ const initTheme = themeMap[Theme.resolvedTheme];
7
7
 
8
8
  let script = document.createElement('script');
9
9
  script.src = 'https://utteranc.es/client.js';
@@ -22,8 +22,8 @@
22
22
  {%- comment -%}
23
23
  Credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347>
24
24
  {%- endcomment -%}
25
- if (event.source === window && event.data && event.data.id === Theme.ID) {
26
- newTheme = themeMapper[Theme.visualState];
25
+ if (event.source === window && event.data && event.data.id === Theme.eventId) {
26
+ newTheme = themeMap[Theme.resolvedTheme];
27
27
 
28
28
  const message = {
29
29
  type: 'set-theme',
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  Date format snippet
3
- See: ${JS_ROOT}/utils/locale-dateime.js
3
+ See: ${JS_ROOT}/modules/components/locale-datetime.js
4
4
  -->
5
5
 
6
6
  {% assign df_strftime = site.data.locales[include.lang].df.post.strftime | default: '%d/%m/%Y' %}
data/_includes/head.html CHANGED
@@ -2,8 +2,6 @@
2
2
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
3
3
  <meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
4
4
  <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1b1b1e">
5
- <meta name="mobile-web-app-capable" content="yes">
6
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
7
5
  <meta
8
6
  name="viewport"
9
7
  content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
@@ -50,11 +48,24 @@
50
48
 
51
49
  {{ seo_tags }}
52
50
 
51
+ {%- if site.social.fediverse_handle %}
52
+ <!-- Fediverse handle/creator -->
53
+ <meta name="fediverse:creator" content="{{ site.social.fediverse_handle }}">
54
+ {% endif %}
55
+
53
56
  <title>
54
57
  {%- unless page.layout == 'home' -%}
55
- {{ page.title | append: ' | ' }}
58
+ {%- capture title -%}
59
+ {%- if page.collection == 'tabs' -%}
60
+ {%- assign tab_key = page.title | downcase -%}
61
+ {{- site.data.locales[include.lang].tabs[tab_key] -}}
62
+ {%- else -%}
63
+ {{- page.title -}}
64
+ {%- endif -%}
65
+ {%- endcapture -%}
66
+ {{- title | append: ' | ' -}}
56
67
  {%- endunless -%}
57
- {{ site.title }}
68
+ {{- site.title -}}
58
69
  </title>
59
70
 
60
71
  {% include_cached favicons.html %}
@@ -70,7 +81,7 @@
70
81
 
71
82
  <!-- Bootstrap -->
72
83
  {% unless jekyll.environment == 'production' %}
73
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css">
84
+ <link rel="stylesheet" href="{{ site.data.origin.cors.bootstrap.css }}">
74
85
  {% endunless %}
75
86
 
76
87
  <!-- Theme style -->
@@ -67,7 +67,6 @@
67
67
  {% if page.math %}
68
68
  <!-- MathJax -->
69
69
  <script src="{{ '/assets/js/data/mathjax.js' | relative_url }}"></script>
70
- <script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
71
70
  <script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script>
72
71
  {% endif %}
73
72
 
@@ -1,9 +1,7 @@
1
1
  {% comment %}
2
-
3
2
  Convert the alias of the syntax language to the official name
4
3
 
5
4
  See: <https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers>
6
-
7
5
  {% endcomment %}
8
6
 
9
7
  {% assign _lang = include.language | default: '' %}
@@ -20,13 +18,13 @@
20
18
  {% when 'coffeescript', 'coffee', 'coffee-script' %}
21
19
  {{ 'CoffeeScript' }}
22
20
  {% when 'cs', 'csharp' %}
23
- {{ 'C#' }}
21
+ {{ 'C#' }}
24
22
  {% when 'erl' %}
25
23
  {{ 'Erlang' }}
26
24
  {% when 'graphql' %}
27
- {{ 'GraphQL' }}
25
+ {{ 'GraphQL' }}
28
26
  {% when 'haskell', 'hs' %}
29
- {{ 'Haskell' }}
27
+ {{ 'Haskell' }}
30
28
  {% when 'javascript', 'js' %}
31
29
  {{ 'JavaScript' }}
32
30
  {% when 'make', 'mf', 'gnumake', 'bsdmake' %}
@@ -39,22 +37,22 @@
39
37
  {{ 'Objective-C' }}
40
38
  {% when 'perl', 'pl' %}
41
39
  {{ 'Perl' }}
42
- {% when 'php','php3','php4','php5' %}
40
+ {% when 'php', 'php3', 'php4', 'php5' %}
43
41
  {{ 'PHP' }}
44
42
  {% when 'py' %}
45
43
  {{ 'Python' }}
46
44
  {% when 'rb' %}
47
45
  {{ 'Ruby' }}
48
- {% when 'rs','no_run','ignore','should_panic' %}
46
+ {% when 'rs', 'no_run', 'ignore', 'should_panic' %}
49
47
  {{ 'Rust' }}
50
48
  {% when 'bash', 'zsh', 'ksh', 'sh' %}
51
49
  {{ 'Shell' }}
52
50
  {% when 'st', 'squeak' %}
53
51
  {{ 'Smalltalk' }}
54
- {% when 'tex'%}
52
+ {% when 'tex' %}
55
53
  {{ 'TeX' }}
56
54
  {% when 'latex' %}
57
- {{ 'LaTex' }}
55
+ {{ 'LaTeX' }}
58
56
  {% when 'ts', 'typescript' %}
59
57
  {{ 'TypeScript' }}
60
58
  {% when 'vb', 'visualbasic' %}
@@ -17,7 +17,7 @@
17
17
  {%- comment -%} Add media resources subpath prefix {%- endcomment -%}
18
18
  {% assign url = include.subpath | default: '' | append: '/' | append: url %}
19
19
 
20
- {%- comment -%} Prepend CND URL {%- endcomment -%}
20
+ {%- comment -%} Prepend CDN URL {%- endcomment -%}
21
21
  {% if site.cdn %}
22
22
  {% assign url = site.cdn | append: '/' | append: url %}
23
23
  {% endif %}
@@ -1,24 +1,28 @@
1
1
  <aside
2
2
  id="notification"
3
- class="toast"
3
+ class="toast w-auto rounded-5 text-nowrap"
4
4
  role="alert"
5
5
  aria-live="assertive"
6
6
  aria-atomic="true"
7
7
  data-bs-animation="true"
8
8
  data-bs-autohide="false"
9
9
  >
10
- <div class="toast-header">
10
+ <div class="d-flex align-items-center">
11
+ <div class="toast-body ps-3">
12
+ {{- site.data.locales[include.lang].notification.update_found -}}
13
+ </div>
11
14
  <button
12
15
  type="button"
13
- class="btn-close ms-auto"
16
+ class="btn btn-primary btn-sm rounded-2 py-0"
17
+ aria-label="Update"
18
+ >
19
+ {{- site.data.locales[include.lang].notification.update -}}
20
+ </button>
21
+ <button
22
+ type="button"
23
+ class="btn-close mx-3 ms-2"
14
24
  data-bs-dismiss="toast"
15
25
  aria-label="Close"
16
26
  ></button>
17
27
  </div>
18
- <div class="toast-body text-center pt-0">
19
- <p class="px-2 mb-3">{{ site.data.locales[include.lang].notification.update_found }}</p>
20
- <button type="button" class="btn btn-primary" aria-label="Update">
21
- {{ site.data.locales[include.lang].notification.update }}
22
- </button>
23
- </div>
24
28
  </aside>
@@ -0,0 +1,23 @@
1
+ <!-- Link to edit the post to contribute. -->
2
+
3
+ {% assign enabled = site.actions.edit_post.enabled %}
4
+ {% assign url = site.actions.edit_post.url %}
5
+ {% assign static_url = site.actions.edit_post.static_url %}
6
+
7
+ {% unless static_url %}
8
+ {% assign url = url | append: '/' | append: page.path %}
9
+ {% endunless %}
10
+
11
+ {% if enabled %}
12
+ <div class="post-edit">
13
+ {% assign edit = site.data.locales[include.lang].post.edit %}
14
+ <a
15
+ href="{{ url }}"
16
+ target="_blank"
17
+ rel="noopener"
18
+ >
19
+ <i class="fa fa-pen fa-fw me-1"></i>
20
+ <span>{{ edit }}</span>
21
+ </a>
22
+ </div>
23
+ {% endif %}
@@ -1,4 +1,4 @@
1
- <!-- The paginator for post list on HomgPage. -->
1
+ <!-- The paginator for post list on HomePage. -->
2
2
 
3
3
  <nav aria-label="Page Navigation">
4
4
  <ul class="pagination align-items-center mt-4 mb-0">
@@ -173,7 +173,7 @@
173
173
  {% assign _parent = _right | slice: 1, 4 %}
174
174
 
175
175
  {% if _parent == '</a>' %}
176
- <!-- add class to exist <a> tag -->
176
+ <!-- add class to existing <a> tag -->
177
177
  {% assign _size = _img_content | size | minus: 1 %}
178
178
  {% capture _class %}
179
179
  class="img-link{% unless _lqip %} shimmer{% endunless %}"
@@ -40,11 +40,53 @@
40
40
  </ul>
41
41
  </nav>
42
42
 
43
- <div class="sidebar-bottom d-flex flex-wrap align-items-center w-100">
44
- {% unless site.theme_mode %}
45
- <button type="button" class="btn btn-link nav-link" aria-label="Switch Mode" id="mode-toggle">
46
- <i class="fas fa-adjust"></i>
47
- </button>
43
+ <div class="sidebar-bottom d-flex flex-wrap align-items-center w-100">
44
+ {% unless site.theme_mode == 'light' or site.theme_mode == 'dark' %}
45
+ {%- capture icon_system -%}
46
+ <i class="fa-solid fa-display" data-theme-mode="system"></i>
47
+ {%- endcapture -%}
48
+
49
+ {%- capture icon_light -%}
50
+ <i class="fa-regular fa-sun" data-theme-mode="light"></i>
51
+ {%- endcapture -%}
52
+
53
+ {%- capture icon_dark -%}
54
+ <i class="fa-regular fa-moon" data-theme-mode="dark"></i>
55
+ {%- endcapture -%}
56
+
57
+ <div class="btn-group dropup">
58
+ <button
59
+ type="button"
60
+ class="btn btn-link nav-link"
61
+ aria-label="Switch Mode"
62
+ id="mode-toggle"
63
+ data-bs-toggle="dropdown"
64
+ >
65
+ {{- icon_light -}}
66
+ {{- icon_dark -}}
67
+ {{- icon_system -}}
68
+ </button>
69
+ <ul class="dropdown-menu rounded-3 mb-1 p-1">
70
+ <li>
71
+ <button class="dropdown-item d-flex align-items-center" type="button" data-theme-mode="light">
72
+ {{- icon_light -}}
73
+ {{- site.data.locales[lang].theme.light -}}
74
+ </button>
75
+ </li>
76
+ <li>
77
+ <button class="dropdown-item d-flex align-items-center" type="button" data-theme-mode="dark">
78
+ {{- icon_dark -}}
79
+ {{- site.data.locales[lang].theme.dark -}}
80
+ </button>
81
+ </li>
82
+ <li>
83
+ <button class="dropdown-item d-flex align-items-center" type="button" data-theme-mode="system">
84
+ {{- icon_system -}}
85
+ {{- site.data.locales[lang].theme.system -}}
86
+ </button>
87
+ </li>
88
+ </ul>
89
+ </div>
48
90
 
49
91
  {% if site.data.contact.size > 0 %}
50
92
  <span class="icon-border"></span>
@@ -68,7 +110,7 @@
68
110
  {%- endunless -%}
69
111
  {%- assign email = site.social.email | split: '@' -%}
70
112
  {%- capture url -%}
71
- javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
113
+ javascript:void(location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@'))
72
114
  {%- endcapture -%}
73
115
  {% when 'rss' %}
74
116
  {% assign url = '/feed.xml' | relative_url %}
@@ -8,13 +8,14 @@ layout: compress
8
8
 
9
9
  {% include lang.html %}
10
10
 
11
- {% if site.theme_mode %}
12
- {% capture prefer_mode %}data-mode="{{ site.theme_mode }}"{% endcapture %}
13
- {% endif %}
14
-
15
11
  <!-- `site.alt_lang` can specify a language different from the UI -->
16
- <html lang="{{ page.lang | default: site.alt_lang | default: site.lang }}" {{ prefer_mode }}>
17
- {% include head.html %}
12
+ <html
13
+ lang="{{ page.lang | default: site.alt_lang | default: site.lang }}"
14
+ {%- if site.theme_mode == 'light' or site.theme_mode == 'dark' -%}
15
+ data-bs-theme="{{ site.theme_mode }}"
16
+ {%- endif -%}
17
+ >
18
+ {% include head.html lang=lang %}
18
19
 
19
20
  <body>
20
21
  {% include sidebar.html lang=lang %}
data/_layouts/post.html CHANGED
@@ -113,9 +113,7 @@ script_includes:
113
113
  <dialog id="toc-popup" class="p-0">
114
114
  <div class="header d-flex flex-row align-items-center justify-content-between">
115
115
  <div class="label text-truncate py-2 ms-4">{{- page.title -}}</div>
116
- <button id="toc-popup-close" type="button" class="btn mx-1 my-1 opacity-75">
117
- <i class="fas fa-close"></i>
118
- </button>
116
+ <button id="toc-popup-close" type="button" class="btn-close btn-sm mx-3" aria-label="Close"></button>
119
117
  </div>
120
118
  <div id="toc-popup-content" class="px-4 py-3 pb-4"></div>
121
119
  </dialog>
@@ -126,16 +124,21 @@ script_includes:
126
124
  </div>
127
125
 
128
126
  <div class="post-tail-wrapper text-muted">
129
- <!-- categories -->
130
- {% if page.categories.size > 0 %}
131
- <div class="post-meta mb-3">
132
- <i class="far fa-folder-open fa-fw me-1"></i>
133
- {% for category in page.categories %}
134
- <a href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/">{{ category }}</a>
135
- {%- unless forloop.last -%},{%- endunless -%}
136
- {% endfor %}
137
- </div>
138
- {% endif %}
127
+ <div class="d-flex justify-content-between align-items-center gap-3 mb-3">
128
+ <!-- categories -->
129
+ {% if page.categories.size > 0 %}
130
+ <div class="post-meta">
131
+ <i class="far fa-folder-open fa-fw me-1"></i>
132
+ {% for category in page.categories %}
133
+ <a href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/">{{ category }}</a>
134
+ {%- unless forloop.last -%},{%- endunless -%}
135
+ {% endfor %}
136
+ </div>
137
+ {% endif %}
138
+
139
+ <!-- "Edit this post" link -->
140
+ {% include post-edit.html lang=lang %}
141
+ </div>
139
142
 
140
143
  <!-- tags -->
141
144
  {% if page.tags.size > 0 %}
@@ -1,3 +1,9 @@
1
+ @mixin color-scheme($mode) {
2
+ @media (prefers-color-scheme: #{$mode}) {
3
+ @content;
4
+ }
5
+ }
6
+
1
7
  @mixin text-ellipsis {
2
8
  overflow: hidden;
3
9
  text-overflow: ellipsis;
@@ -28,3 +28,9 @@ $code-icon-width: 1.75rem !default;
28
28
 
29
29
  $font-family-base: 'Source Sans Pro', 'Microsoft Yahei', sans-serif !default;
30
30
  $font-family-heading: Lato, 'Microsoft Yahei', sans-serif !default;
31
+
32
+ /* Theme mode settings */
33
+
34
+ $theme-attr: 'data-bs-theme'; /* the attribute used to indicate the resolved theme */
35
+ $theme-options: light, dark;
36
+ $theme: null !default; /* set by Jekyll site configuration */