Merge branch 'master' into production

This commit is contained in:
Cotes Chung 2023-03-31 05:46:37 +08:00
commit 387f0ec64a
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
8 changed files with 49 additions and 40 deletions

View file

@ -2,6 +2,15 @@
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.
## [5.6.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.6.0...v5.6.1) (2023-03-30)
### Bug Fixes
* **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))
* 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))
* pageviews not updated immediately ([8b4f99c](https://github.com/cotes2020/jekyll-theme-chirpy/commit/8b4f99c87f9a9227f47e84fb39d7b0f551d6f4dd))
## [5.6.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.5.2...v5.6.0) (2023-03-17)

View file

@ -1,24 +1,21 @@
<!--
The Disqus lazy loading.
-->
<!-- The Disqus lazy loading. -->
<div id="disqus_thread" class="pt-2 pb-2">
<p class="text-center text-muted small">
Comments powered by <a href="https://disqus.com/">Disqus</a>.
</p>
<p class="text-center text-muted small">Comments powered by <a href="https://disqus.com/">Disqus</a>.</p>
</div>
<script type="text/javascript">
var disqus_config = function () {
this.page.url = '{{ page.url | absolute_url }}';
this.page.identifier = '{{ page.url }}';
};
/* Lazy loading */
var disqus_observer = new IntersectionObserver(function (entries) {
if(entries[0].isIntersecting) {
var disqus_observer = new IntersectionObserver(
function (entries) {
if (entries[0].isIntersecting) {
(function () {
var d = document, s = d.createElement('script');
var d = document,
s = d.createElement('script');
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
@ -26,16 +23,17 @@
disqus_observer.disconnect();
}
}, { threshold: [0] });
},
{ threshold: [0] }
);
disqus_observer.observe(document.querySelector('#disqus_thread'));
/* Auto switch theme */
function reloadDisqus() {
if (event.source === window && event.data &&
event.data.direction === ModeToggle.ID) {
if (event.source === window && event.data && event.data.direction === ModeToggle.ID) {
/* Disqus hasn't been loaded */
if (typeof DISQUS === "undefined") {
if (typeof DISQUS === 'undefined') {
return;
}
@ -45,10 +43,7 @@
}
}
const modeToggle = document.querySelector(".mode-toggle");
if (typeof modeToggle !== "undefined") {
window.addEventListener("message", reloadDisqus);
if (document.querySelector('.mode-toggle')) {
window.addEventListener('message', reloadDisqus);
}
</script>

View file

@ -193,8 +193,8 @@ function fetchProxyPageviews() {
type: 'GET',
url: PvOpts.getProxyMeta(),
dataType: 'jsonp',
jsonpCallback: 'displayPageviews',
success: (data) => {
displayPageviews(data);
PvStorage.saveProxyCache(JSON.stringify(data));
},
error: (jqXHR, textStatus, errorThrown) => {

View file

@ -1,4 +1,5 @@
export function toc() {
if (document.querySelector('#core-wrapper h2,#core-wrapper h3')) {
// see: https://github.com/tscanlin/tocbot#usage
tocbot.init({
tocSelector: '#toc',
@ -8,4 +9,5 @@ export function toc() {
orderedList: false,
scrollSmooth: false
});
}
}

View file

@ -1,7 +1,7 @@
/*!
* The styles for Jekyll theme Chirpy
*
* Chirpy v5.6.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
* Chirpy v5.6.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
* © 2019 Cotes Chung
* MIT Licensed
*/

View file

@ -2,7 +2,7 @@
Gem::Specification.new do |spec|
spec.name = "jekyll-theme-chirpy"
spec.version = "5.6.0"
spec.version = "5.6.1"
spec.authors = ["Cotes Chung"]
spec.email = ["cotes.chung@gmail.com"]

View file

@ -1,6 +1,6 @@
{
"name": "jekyll-theme-chirpy",
"version": "5.6.0",
"version": "5.6.1",
"description": "A minimal, responsive and feature-rich Jekyll theme for technical writing.",
"repository": {
"type": "git",
@ -21,15 +21,15 @@
"fixlint": "npm run test -- --fix"
},
"devDependencies": {
"@babel/core": "^7.21.0",
"@babel/core": "^7.21.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.20.2",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-terser": "^0.4.0",
"rimraf": "^4.4.0",
"rollup": "^3.19.1",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"rollup-plugin-license": "^3.0.1",
"stylelint": "^15.2.0",
"stylelint": "^15.3.0",
"stylelint-config-standard-scss": "^7.0.1"
}
}

View file

@ -16,6 +16,9 @@ function build(filename) {
name: 'Chirpy',
sourcemap: !isProd
},
watch: {
include: `${JS_SRC}/**`
},
plugins: [
babel({
babelHelpers: 'bundled',