jekyll-theme-chirpy 4.1.1 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/_config.yml +3 -2
  3. data/_data/locales/en.yml +3 -4
  4. data/_data/locales/id-ID.yml +86 -0
  5. data/_data/locales/zh-CN.yml +3 -4
  6. data/_includes/disqus.html +42 -13
  7. data/_includes/footer.html +3 -3
  8. data/_includes/head.html +5 -5
  9. data/_includes/js-selector.html +1 -1
  10. data/_includes/lang.html +8 -0
  11. data/_includes/panel.html +5 -3
  12. data/_includes/post-nav.html +4 -4
  13. data/_includes/post-sharing.html +3 -3
  14. data/_includes/read-time.html +5 -4
  15. data/_includes/refactor-content.html +29 -13
  16. data/_includes/related-posts.html +1 -1
  17. data/_includes/search-loader.html +2 -2
  18. data/_includes/search-results.html +1 -1
  19. data/_includes/sidebar.html +2 -2
  20. data/_includes/timeago.html +3 -3
  21. data/_includes/topbar.html +9 -9
  22. data/_layouts/archives.html +3 -1
  23. data/_layouts/categories.html +5 -3
  24. data/_layouts/category.html +3 -1
  25. data/_layouts/default.html +3 -1
  26. data/_layouts/home.html +3 -1
  27. data/_layouts/page.html +1 -1
  28. data/_layouts/post.html +9 -7
  29. data/_layouts/tag.html +3 -1
  30. data/_sass/addon/commons.scss +20 -4
  31. data/_sass/addon/syntax.scss +74 -22
  32. data/_sass/colors/dark-syntax.scss +17 -14
  33. data/_sass/colors/dark-typography.scss +15 -13
  34. data/_sass/colors/light-syntax.scss +4 -1
  35. data/_sass/colors/light-typography.scss +12 -11
  36. data/_sass/jekyll-theme-chirpy.scss +1 -1
  37. data/_sass/layout/post.scss +0 -10
  38. data/assets/404.html +6 -4
  39. data/assets/feed.xml +1 -1
  40. data/assets/js/data/search.json +1 -1
  41. data/assets/js/dist/categories.min.js +1 -1
  42. data/assets/js/dist/commons.min.js +1 -1
  43. data/assets/js/dist/home.min.js +1 -1
  44. data/assets/js/dist/page.min.js +2 -2
  45. data/assets/js/dist/post.min.js +2 -2
  46. data/assets/js/dist/pvreport.min.js +1 -1
  47. metadata +4 -3
  48. data/assets/js/lib/jquery.disqusloader.min.js +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b74c61badf848a781d393b474a4871980d80fa6927007d66b1a2fe3f5793fe4
4
- data.tar.gz: 66cf98db41a4d6bf8d3b8de71e956257aba10862f166467841d25f475fc1cf01
3
+ metadata.gz: 27316a10dd6ae0f3873b7387583c07882a4f7925914ec0230b3e5256d3beff2a
4
+ data.tar.gz: 43a5cb6d96da78632899cdd8803f2b690c964efffea87f34797d69d6c6541a3e
5
5
  SHA512:
6
- metadata.gz: eb409eb873922335d8c47c7fd32503313639556e600840062ed81bd33bbaafba249d1c98b87f681d7a5d95257482c96f1b3451c54b64c6a726a8bbfdb79ea24e
7
- data.tar.gz: aa75e51e9e2528c388d77867b0c3015948a9273f9bba428deb80e0a5b4a3ed288914c86a7d886adcba550564bc0bdec1fe31e3263795c0747183870be9c315e4
6
+ metadata.gz: 1e6a42ae09f8ae1b0cba266160cf8f4896f7e791c4b636cea2011563c711aaaa8f1be8ed8e3672a414b45fbc501ec212ca5ae562a5996cf7c17832c2079315d5
7
+ data.tar.gz: a9f06936e1d5682b2b2986f8b871b923217f13aa0a3cbbb219d16527f60291cb004b83e32c99f0ebbb56e032fed179df9412d57e03c80a5e685868ab174f332b
data/_config.yml CHANGED
@@ -7,8 +7,9 @@ theme: jekyll-theme-chirpy
7
7
  # change below value to '/projectname'.
8
8
  baseurl: ''
9
9
 
10
- # The language of the site layout › http://www.lingoes.net/en/translator/langcode.htm
11
- # Go to folder '_data/locales' to check the available language options
10
+ # The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm
11
+ # If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed,
12
+ # otherwise, the layout language will use the default value of 'en'.
12
13
  lang: en
13
14
 
14
15
  # Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
data/_data/locales/en.yml CHANGED
@@ -16,10 +16,11 @@ tabs:
16
16
  archives: Archives
17
17
  about: About
18
18
 
19
- # text displayed in the search bar
19
+ # the text displayed in the search bar & search results
20
20
  search:
21
21
  hint: search
22
22
  cancel: Cancel
23
+ no_results: Oops! No result founds.
23
24
 
24
25
  panel:
25
26
  lastmod: Recent Update
@@ -75,9 +76,7 @@ post:
75
76
  button:
76
77
  next: Newer
77
78
  previous: Older
78
- copy:
79
- title: Copy link
80
- succeed: Link copied successfully!
79
+ copy: Copied!
81
80
  # pinned prompt of posts list on homepage
82
81
  pin_prompt: Pinned
83
82
 
@@ -0,0 +1,86 @@
1
+ # The layout text of site
2
+
3
+ # ----- Commons label -----
4
+
5
+ layout:
6
+ post: Postingan
7
+ category: Kategori
8
+ tag: Tagar
9
+
10
+ # The tabs of sidebar
11
+ tabs:
12
+ # format: <filename_without_extension>: <value>
13
+ home: Beranda
14
+ categories: Kategori
15
+ tags: Tagar
16
+ archives: Arsip
17
+ about: Tentang
18
+
19
+ # the text displayed in the search bar & search results
20
+ search:
21
+ hint: Cari
22
+ cancel: Batal
23
+ no_results: Ups! Tidak ada hasil yang ditemukan.
24
+
25
+ panel:
26
+ lastmod: Postingan Terbaru
27
+ trending_tags: Tagar Terpopuler
28
+ toc: Konten
29
+
30
+ # The liquid date format › http://strftime.net/
31
+ date_format:
32
+ tooltip: "%a, %e %b, %Y, %l:%M %p"
33
+ post:
34
+ long: "%e %b, %Y"
35
+ short: "%e %b"
36
+ archive_month: "%b"
37
+
38
+ copyright:
39
+ # Shown at the bottom of the post
40
+ license:
41
+ template: Postingan ini dilisensikan di bawah :LICENSE_NAME oleh penulis.
42
+ name: CC BY 4.0
43
+ link: https://creativecommons.org/licenses/by/4.0/
44
+
45
+ # Displayed in the footer
46
+ brief: Sebagian konten dilindungi.
47
+ verbose: >-
48
+ Kecuali jika dinyatakan, Postingan blog di situs ini dilisensikan
49
+ di bawah Lisensi Creative Commons Attribution 4.0 International (CC BY 4.0) oleh penulis.
50
+
51
+ meta: Didukung oleh :PLATFORM dengan tema :THEME.
52
+
53
+ not_found:
54
+ statment: Maaf, kami gagal menemukan URL itu atau memang mengarah ke sesuatu yang tidak ada.
55
+ hint_template: :HEAD_BAK untuk mencoba mencari kembali, atau cari di :ARCHIVES_PAGE.
56
+ head_back: Kembali ke Beranda
57
+ archives_page: Halaman Arsip
58
+
59
+ # ----- Posts related labels -----
60
+
61
+ post:
62
+ published: "pada"
63
+ updated: Diperbarui
64
+ timeago:
65
+ day: hari yang lalu
66
+ hour: jam yang lalu
67
+ minute: menit yang lalu
68
+ just_now: baru saja
69
+ words: kata
70
+ pageview_measure: dilihat
71
+ read_time:
72
+ unit: menit
73
+ prompt: baca
74
+ relate_posts: Postingan Lainya
75
+ share: Bagikan
76
+ button:
77
+ next: Terbaru
78
+ previous: Terlama
79
+ copy: Disalin!
80
+ # pinned prompt of posts list on homepage
81
+ pin_prompt: Disematkan
82
+
83
+ # categories page
84
+ categories:
85
+ category_measure: kategori
86
+ post_measure: Postingan
@@ -16,10 +16,11 @@ tabs:
16
16
  archives: 归档
17
17
  about: 关于
18
18
 
19
- # text displayed in the search bar
19
+ # the text displayed in the search bar & search results
20
20
  search:
21
21
  hint: 搜索
22
22
  cancel: 取消
23
+ no_results: 搜索结果为空
23
24
 
24
25
  panel:
25
26
  lastmod: 最近更新
@@ -74,9 +75,7 @@ post:
74
75
  button:
75
76
  next: 下一篇
76
77
  previous: 上一篇
77
- copy:
78
- title: 分享链接
79
- succeed: 链接已复制!
78
+ copy: 已复制!
80
79
  # pinned prompt of posts list on homepage
81
80
  pin_prompt: 顶置
82
81
 
@@ -1,25 +1,54 @@
1
1
  <!--
2
2
  The Disqus lazy loading.
3
- Powered by: <https://github.com/osvaldasvalutis/disqusLoader.js>
4
3
  -->
5
4
 
6
- <div id="disqus" class="pt-2 pb-2">
7
- <p class="text-center text-muted small pb-5">
5
+ <div id="disqus_thread" class="pt-2 pb-2">
6
+ <p class="text-center text-muted small mb-5">
8
7
  Comments powered by <a href="https://disqus.com/">Disqus</a>.
9
8
  </p>
10
9
  </div>
11
10
 
12
- <script src="{{ '/assets/js/lib/jquery.disqusloader.min.js' | relative_url }}"></script>
13
- <script>
14
- const options = {
15
- scriptUrl: '//{{ site.disqus.shortname }}.disqus.com/embed.js',
11
+ <script type="text/javascript">
12
+ var disqus_config = function () {
13
+ this.page.url = '{{ page.url | absolute_url }}';
14
+ this.page.identifier = '{{ page.url }}';
15
+ };
16
+
17
+ /* Lazy loading */
18
+
19
+ var disqus_observer = new IntersectionObserver(function (entries) {
20
+ if(entries[0].isIntersecting) {
21
+ (function () {
22
+ var d = document, s = d.createElement('script');
23
+ s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
24
+ s.setAttribute('data-timestamp', +new Date());
25
+ (d.head || d.body).appendChild(s);
26
+ })();
16
27
 
17
- disqusConfig: function() {
18
- this.page.title = '{{ page.title }}';
19
- this.page.url = '{{ page.url | absolute_url }}';
20
- this.page.identifier = '{{ page.url }}';
28
+ disqus_observer.disconnect();
21
29
  }
22
- };
30
+ }, { threshold: [0] });
31
+
32
+ disqus_observer.observe(document.querySelector('#disqus_thread'));
33
+
34
+ /* Auto switch theme */
35
+
36
+ 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 });
44
+ }
45
+ }
46
+
47
+ const modeToggle = document.querySelector(".mode-toggle");
48
+
49
+ if (modeToggle !== null) {
50
+ modeToggle.addEventListener('click', reloadDisqus);
51
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
52
+ }
23
53
 
24
- $.disqusLoader('#disqus', options);
25
54
  </script>
@@ -8,9 +8,9 @@
8
8
  <p class="mb-0">
9
9
  © {{ 'now' | date: "%Y" }}
10
10
  <a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
11
- {% if site.data.locales[site.lang].copyright.brief %}
11
+ {% if site.data.locales[lang].copyright.brief %}
12
12
  <span data-toggle="tooltip" data-placement="top"
13
- title="{{ site.data.locales[site.lang].copyright.verbose }}">{{ site.data.locales[site.lang].copyright.brief }}</span>
13
+ title="{{ site.data.locales[lang].copyright.verbose }}">{{ site.data.locales[lang].copyright.brief }}</span>
14
14
  {% endif %}
15
15
  </p>
16
16
  </div>
@@ -25,7 +25,7 @@
25
25
  <a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
26
26
  {% endcapture %}
27
27
 
28
- {{ site.data.locales[site.lang].meta
28
+ {{ site.data.locales[lang].meta
29
29
  | default: 'Powered by :PLATFORM with :THEME theme.'
30
30
  | replace: ':PLATFORM', _platform | replace: ':THEME', _theme
31
31
  }}
data/_includes/head.html CHANGED
@@ -8,11 +8,11 @@
8
8
 
9
9
  {% if page.layout == 'home' or page.layout == 'post' %}
10
10
 
11
- <!-- i18n for timeago.js -->
12
- <meta name="day-prompt" content="{{ site.data.locales[site.lang].post.timeago.day | default: "d ago" }}">
13
- <meta name="hour-prompt" content="{{ site.data.locales[site.lang].post.timeago.hour | default: "hr ago" }}">
14
- <meta name="minute-prompt" content="{{ site.data.locales[site.lang].post.timeago.minute | default: "min ago" }}">
15
- <meta name="justnow-prompt" content="{{ site.data.locales[site.lang].post.timeago.just_now | default: "just now" }}">
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
16
 
17
17
  {% if site.google_analytics.pv.proxy_endpoint %}
18
18
  <meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
@@ -14,7 +14,7 @@
14
14
 
15
15
  {% if page.layout == 'post' or page.layout == 'page' %}
16
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"></script>
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>
18
18
  {% endif %}
19
19
 
20
20
  {% if page.layout == 'home'
@@ -0,0 +1,8 @@
1
+ {% comment %}
2
+ Detect appearance language and return it through variable "lang"
3
+ {% endcomment %}
4
+ {% if site.data.locales[site.lang] %}
5
+ {% assign lang = site.lang %}
6
+ {% else %}
7
+ {% assign lang = 'en' %}
8
+ {% endif %}
data/_includes/panel.html CHANGED
@@ -2,6 +2,8 @@
2
2
  The Pannel on right side (Desktop views)
3
3
  -->
4
4
 
5
+ {% include lang.html %}
6
+
5
7
  <div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
6
8
 
7
9
  <div class="access">
@@ -11,7 +13,7 @@
11
13
  {% if update_list.size > 0 %}
12
14
 
13
15
  <div id="access-lastmod" class="post">
14
- <span>{{- site.data.locales[site.lang].panel.lastmod | default: 'Recent Update' -}}</span>
16
+ <span>{{- site.data.locales[lang].panel.lastmod -}}</span>
15
17
  <ul class="post-content pl-0 pb-1 ml-1 mt-2">
16
18
 
17
19
  {% for item in update_list %}
@@ -30,7 +32,7 @@
30
32
 
31
33
  {% if trending_tags.size > 0 %}
32
34
  <div id="access-tags">
33
- <span>{{- site.data.locales[site.lang].panel.trending_tags | default: 'Trending Tags' -}}</span>
35
+ <span>{{- site.data.locales[lang].panel.trending_tags -}}</span>
34
36
  <div class="d-flex flex-wrap mt-3 mb-1 mr-3">
35
37
 
36
38
  {% for tag_name in trending_tags %}
@@ -48,7 +50,7 @@
48
50
  <script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></script>
49
51
  <div id="toc-wrapper" class="pl-0 pr-4 mb-5">
50
52
  <span class="pl-3 pt-2 mb-2">
51
- {{- site.data.locales[site.lang].panel.toc | default: 'Contents' -}}
53
+ {{- site.data.locales[lang].panel.toc -}}
52
54
  </span>
53
55
  <nav id="toc" data-toggle="toc"></nav>
54
56
  </div>
@@ -5,24 +5,24 @@
5
5
  <div class="post-navigation d-flex justify-content-between">
6
6
  {% if page.previous.url %}
7
7
  <a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
8
- prompt="{{ site.data.locales[site.lang].post.button.previous | default: 'previous' }}">
8
+ prompt="{{ site.data.locales[lang].post.button.previous }}">
9
9
  <p>{{ page.previous.title }}</p>
10
10
  </a>
11
11
  {% else %}
12
12
  <span class="btn btn-outline-primary disabled"
13
- prompt="{{ site.data.locales[site.lang].post.button.previous | default: 'previous' }}">
13
+ prompt="{{ site.data.locales[lang].post.button.previous }}">
14
14
  <p>-</p>
15
15
  </span>
16
16
  {% endif %}
17
17
 
18
18
  {% if page.next.url %}
19
19
  <a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
20
- prompt="{{ site.data.locales[site.lang].post.button.next | default: 'next' }}">
20
+ prompt="{{ site.data.locales[lang].post.button.next }}">
21
21
  <p>{{ page.next.title }}</p>
22
22
  </a>
23
23
  {% else %}
24
24
  <span class="btn btn-outline-primary disabled"
25
- prompt="{{ site.data.locales[site.lang].post.button.next | default: 'next' }}">
25
+ prompt="{{ site.data.locales[lang].post.button.next }}">
26
26
  <p>-</p>
27
27
  </span>
28
28
  {% endif %}
@@ -3,7 +3,7 @@
3
3
  -->
4
4
 
5
5
  <div class="share-wrapper">
6
- <span class="share-label text-muted mr-1">{{ site.data.locales[site.lang].post.share | default: 'Share' }}</span>
6
+ <span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
7
7
  <span class="share-icons">
8
8
  {% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
9
9
  {% assign url = page.url | absolute_url %}
@@ -16,9 +16,9 @@
16
16
  </a>
17
17
  {% endfor %}
18
18
 
19
- <i class="fa-fw fas fa-link small" onclick="copyLink('', '{{ site.data.locales[site.lang].post.button.copy.succeed }}')"
19
+ <i class="fa-fw fas fa-link small" onclick="copyLink('', '{{ site.data.locales[lang].post.button.copy.succeed }}')"
20
20
  data-toggle="tooltip" data-placement="top"
21
- title="{{ site.data.locales[site.lang].post.button.copy.title }}">
21
+ title="{{ site.data.locales[lang].post.button.copy.title }}">
22
22
  </i>
23
23
 
24
24
  </span>
@@ -16,14 +16,15 @@
16
16
  {% endunless %}
17
17
 
18
18
  {% capture read_prompt %}
19
- {{- site.data.locales[site.lang].post.read_time.prompt | default: "read" -}}
19
+ {{- site.data.locales[lang].post.read_time.prompt -}}
20
20
  {% endcapture %}
21
21
 
22
22
  <!-- return element -->
23
23
  <span class="readtime" data-toggle="tooltip" data-placement="bottom"
24
- title="{{ words }} {{ site.data.locales[site.lang].post.words | default: "words" }}">
25
- {{- read_time -}}{{" "}}{{- site.data.locales[site.lang].post.read_time.unit | default: "min" -}}
24
+ title="{{ words }} {{ site.data.locales[lang].post.words }}">
25
+ {{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}
26
26
  {%- if include.prompt -%}
27
- {% unless site.lang contains 'zh' %}{{" "}}{% endunless %}{{ read_prompt }}
27
+ {% assign _prompt_words = read_prompt | number_of_words: 'auto' %}
28
+ {% unless _prompt_words > 1 %}{{" "}}{% endunless %}{{ read_prompt }}
28
29
  {%- endif -%}
29
30
  </span>
@@ -102,25 +102,41 @@
102
102
 
103
103
  {% endif %}
104
104
 
105
- <!-- Add lang-badge for code snippets -->
105
+ <!-- Add header for code snippets -->
106
106
 
107
- {% if _content contains '<div class="language-' %}
108
- {% assign _code_splits = _content | split: '<div class="language-' %}
109
- {% assign _new_content = nil %}
107
+ {% if _content contains '<div class="highlight"><code>' %}
108
+ {% assign _code_spippets = _content | split: '<div class="highlight"><code>' %}
109
+ {% assign _new_content = '' %}
110
+
111
+ {% for _snippet in _code_spippets %}
112
+
113
+ {% if forloop.last %}
114
+ {% assign _new_content = _new_content | append: _snippet %}
110
115
 
111
- {% for _snippet in _code_splits %}
112
- {% if forloop.first %}
113
- {% assign _new_content = _snippet %}
114
116
  {% else %}
115
- {% assign _lang = _snippet | split: ' ' | first %}
116
- {% capture _tag_head %}<div lang="{{_lang}}" class="language-{% endcapture %}
117
- {% assign _new_content = _new_content | append: _tag_head | append: _snippet %}
117
+
118
+ {% assign _left = _snippet | split: '><' | last%}
119
+
120
+ {% if _left contains 'file="' %}
121
+ {% assign _text = _left | split: 'file="' | last | split: '"' | first %}
122
+ {% else %}
123
+ {% assign _text = _left | split: 'language-' | last | split: ' ' | first %}
124
+ {% endif %}
125
+
126
+ {% assign _new_content = _new_content | append: _snippet
127
+ | append: '<div class="code-header" text-data="'
128
+ | append: _text
129
+ | append: '"><button data-original-title="'
130
+ | append: site.data.locales[lang].post.button.copy
131
+ | append: '"><i class="far fa-clone"></i></button></div>'
132
+ | append: '<div class="highlight"><code>'
133
+ %}
134
+
118
135
  {% endif %}
136
+
119
137
  {% endfor %}
120
138
 
121
- {% if _new_content %}
122
- {% assign _content = _new_content %}
123
- {% endif %}
139
+ {% assign _content = _new_content %}
124
140
 
125
141
  {% endif %}
126
142