Skip to content

Commit 387f0ec

Browse files
committed
Merge branch 'master' into production
2 parents 61d9c22 + c45f399 commit 387f0ec

File tree

8 files changed

+49
-40
lines changed

8 files changed

+49
-40
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [5.6.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.6.0...v5.6.1) (2023-03-30)
6+
7+
8+
### Bug Fixes
9+
10+
* **deps:** `tocbot` has no initialization detection ([#957](https://github.com/cotes2020/jekyll-theme-chirpy/issues/957)) ([8225174](https://github.com/cotes2020/jekyll-theme-chirpy/commit/8225174cb5e02fda7b3cc548ec821c876b0a5139))
11+
* mode-toggle leads to Disqus loading failure ([#945](https://github.com/cotes2020/jekyll-theme-chirpy/issues/945)) ([6fec411](https://github.com/cotes2020/jekyll-theme-chirpy/commit/6fec411c18ca5689c467c7b216ddeda02df23623))
12+
* pageviews not updated immediately ([8b4f99c](https://github.com/cotes2020/jekyll-theme-chirpy/commit/8b4f99c87f9a9227f47e84fb39d7b0f551d6f4dd))
13+
514
## [5.6.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.5.2...v5.6.0) (2023-03-17)
615

716

_includes/comments/disqus.html

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
<!--
2-
The Disqus lazy loading.
3-
-->
1+
<!-- The Disqus lazy loading. -->
42
<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>
3+
<p class="text-center text-muted small">Comments powered by <a href="https://disqus.com/">Disqus</a>.</p>
84
</div>
95

106
<script type="text/javascript">
11-
127
var disqus_config = function () {
138
this.page.url = '{{ page.url | absolute_url }}';
149
this.page.identifier = '{{ page.url }}';
1510
};
1611

1712
/* Lazy loading */
18-
var disqus_observer = new IntersectionObserver(function (entries) {
19-
if(entries[0].isIntersecting) {
13+
var disqus_observer = new IntersectionObserver(
14+
function (entries) {
15+
if (entries[0].isIntersecting) {
2016
(function () {
21-
var d = document, s = d.createElement('script');
22-
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
23-
s.setAttribute('data-timestamp', +new Date());
24-
(d.head || d.body).appendChild(s);
17+
var d = document,
18+
s = d.createElement('script');
19+
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
20+
s.setAttribute('data-timestamp', +new Date());
21+
(d.head || d.body).appendChild(s);
2522
})();
2623

2724
disqus_observer.disconnect();
28-
}
29-
}, { threshold: [0] });
25+
}
26+
},
27+
{ threshold: [0] }
28+
);
3029

3130
disqus_observer.observe(document.querySelector('#disqus_thread'));
3231

3332
/* Auto switch theme */
3433
function reloadDisqus() {
35-
if (event.source === window && event.data &&
36-
event.data.direction === ModeToggle.ID) {
34+
if (event.source === window && event.data && event.data.direction === ModeToggle.ID) {
3735
/* Disqus hasn't been loaded */
38-
if (typeof DISQUS === "undefined") {
36+
if (typeof DISQUS === 'undefined') {
3937
return;
4038
}
4139

@@ -45,10 +43,7 @@
4543
}
4644
}
4745

48-
const modeToggle = document.querySelector(".mode-toggle");
49-
50-
if (typeof modeToggle !== "undefined") {
51-
window.addEventListener("message", reloadDisqus);
46+
if (document.querySelector('.mode-toggle')) {
47+
window.addEventListener('message', reloadDisqus);
5248
}
53-
5449
</script>

_javascript/modules/components/pageviews.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ function fetchProxyPageviews() {
193193
type: 'GET',
194194
url: PvOpts.getProxyMeta(),
195195
dataType: 'jsonp',
196-
jsonpCallback: 'displayPageviews',
197196
success: (data) => {
197+
displayPageviews(data);
198198
PvStorage.saveProxyCache(JSON.stringify(data));
199199
},
200200
error: (jqXHR, textStatus, errorThrown) => {

_javascript/modules/components/toc.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
export function toc() {
2-
// see: https://github.com/tscanlin/tocbot#usage
3-
tocbot.init({
4-
tocSelector: '#toc',
5-
contentSelector: '.post-content',
6-
ignoreSelector: '[data-toc-skip]',
7-
headingSelector: 'h2, h3',
8-
orderedList: false,
9-
scrollSmooth: false
10-
});
2+
if (document.querySelector('#core-wrapper h2,#core-wrapper h3')) {
3+
// see: https://github.com/tscanlin/tocbot#usage
4+
tocbot.init({
5+
tocSelector: '#toc',
6+
contentSelector: '.post-content',
7+
ignoreSelector: '[data-toc-skip]',
8+
headingSelector: 'h2, h3',
9+
orderedList: false,
10+
scrollSmooth: false
11+
});
12+
}
1113
}

_sass/jekyll-theme-chirpy.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* The styles for Jekyll theme Chirpy
33
*
4-
* Chirpy v5.6.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
4+
* Chirpy v5.6.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
55
* © 2019 Cotes Chung
66
* MIT Licensed
77
*/

jekyll-theme-chirpy.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |spec|
44
spec.name = "jekyll-theme-chirpy"
5-
spec.version = "5.6.0"
5+
spec.version = "5.6.1"
66
spec.authors = ["Cotes Chung"]
77
spec.email = ["[email protected]"]
88

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jekyll-theme-chirpy",
3-
"version": "5.6.0",
3+
"version": "5.6.1",
44
"description": "A minimal, responsive and feature-rich Jekyll theme for technical writing.",
55
"repository": {
66
"type": "git",
@@ -21,15 +21,15 @@
2121
"fixlint": "npm run test -- --fix"
2222
},
2323
"devDependencies": {
24-
"@babel/core": "^7.21.0",
24+
"@babel/core": "^7.21.3",
2525
"@babel/plugin-proposal-class-properties": "^7.18.6",
2626
"@babel/preset-env": "^7.20.2",
2727
"@rollup/plugin-babel": "^6.0.3",
2828
"@rollup/plugin-terser": "^0.4.0",
29-
"rimraf": "^4.4.0",
30-
"rollup": "^3.19.1",
29+
"rimraf": "^4.4.1",
30+
"rollup": "^3.20.2",
3131
"rollup-plugin-license": "^3.0.1",
32-
"stylelint": "^15.2.0",
32+
"stylelint": "^15.3.0",
3333
"stylelint-config-standard-scss": "^7.0.1"
3434
}
3535
}

rollup.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ function build(filename) {
1616
name: 'Chirpy',
1717
sourcemap: !isProd
1818
},
19+
watch: {
20+
include: `${JS_SRC}/**`
21+
},
1922
plugins: [
2023
babel({
2124
babelHelpers: 'bundled',

0 commit comments

Comments
 (0)