Merge branch 'hotfix/5.2.1'
This commit is contained in:
commit
232927c47c
14 changed files with 42 additions and 46 deletions
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
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.
|
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.2.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.2.0...v5.2.1) (2022-06-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* exclude CHANGELOG from output ([971fe03](https://github.com/cotes2020/jekyll-theme-chirpy/commit/971fe03ec329ae49e7d60fe3af6101cfbd1acd6c))
|
||||||
|
* **PWA:** sometimes update notification is not triggered ([96af729](https://github.com/cotes2020/jekyll-theme-chirpy/commit/96af7291ea5b2c5ed6372e7b6f7725e67c69f1ba))
|
||||||
|
|
||||||
## [5.2.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.1.0...v5.2.0) (2022-06-09)
|
## [5.2.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.1.0...v5.2.0) (2022-06-09)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ exclude:
|
||||||
- '*.gemspec'
|
- '*.gemspec'
|
||||||
- tools
|
- tools
|
||||||
- README.md
|
- README.md
|
||||||
|
- CHANGELOG.md
|
||||||
- LICENSE
|
- LICENSE
|
||||||
- gulpfile.js
|
- gulpfile.js
|
||||||
- node_modules
|
- node_modules
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*!
|
/*!
|
||||||
* The styles for Jekyll theme Chirpy
|
* The styles for Jekyll theme Chirpy
|
||||||
*
|
*
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
2
assets/js/dist/categories.min.js
vendored
2
assets/js/dist/categories.min.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
2
assets/js/dist/commons.min.js
vendored
2
assets/js/dist/commons.min.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
2
assets/js/dist/home.min.js
vendored
2
assets/js/dist/home.min.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
2
assets/js/dist/misc.min.js
vendored
2
assets/js/dist/misc.min.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
2
assets/js/dist/page.min.js
vendored
2
assets/js/dist/page.min.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
2
assets/js/dist/post.min.js
vendored
2
assets/js/dist/post.min.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
2
assets/js/dist/pvreport.min.js
vendored
2
assets/js/dist/pvreport.min.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,50 +3,37 @@ layout: compress
|
||||||
permalink: '/app.js'
|
permalink: '/app.js'
|
||||||
---
|
---
|
||||||
|
|
||||||
const keyWaiting = 'sw-waiting';
|
|
||||||
const $notification = $('#notification');
|
const $notification = $('#notification');
|
||||||
const $btnRefresh = $('#notification .toast-body>button');
|
const $btnRefresh = $('#notification .toast-body>button');
|
||||||
|
|
||||||
function skipWating(registration) {
|
|
||||||
registration.waiting.postMessage('SKIP_WAITING');
|
|
||||||
localStorage.removeItem(keyWaiting);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
/* Registering Service Worker */
|
/* Registering Service Worker */
|
||||||
navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}')
|
navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}')
|
||||||
.then(registration => {
|
.then(registration => {
|
||||||
if (registration) {
|
|
||||||
registration.addEventListener('updatefound', () => {
|
|
||||||
let serviceWorker = registration.installing;
|
|
||||||
|
|
||||||
serviceWorker.addEventListener('statechange', () => {
|
/* in case the user ignores the notification */
|
||||||
if (serviceWorker.state === 'installed') {
|
if (registration.waiting) {
|
||||||
|
$notification.toast('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
registration.addEventListener('updatefound', () => {
|
||||||
|
registration.installing.addEventListener('statechange', () => {
|
||||||
|
if (registration.waiting) {
|
||||||
if (navigator.serviceWorker.controller) {
|
if (navigator.serviceWorker.controller) {
|
||||||
$notification.toast('show');
|
$notification.toast('show');
|
||||||
/* in case the user ignores the notification */
|
|
||||||
localStorage.setItem(keyWaiting, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$btnRefresh.click(() => {
|
$btnRefresh.click(() => {
|
||||||
skipWating(registration);
|
if (registration.waiting) {
|
||||||
|
registration.waiting.postMessage('SKIP_WAITING');
|
||||||
|
}
|
||||||
$notification.toast('hide');
|
$notification.toast('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (localStorage.getItem(keyWaiting)) {
|
|
||||||
if (registration.waiting) {
|
|
||||||
/* there's a new Service Worker waiting to be activated */
|
|
||||||
$notification.toast('show');
|
|
||||||
} else {
|
|
||||||
/* closed all open pages after receiving notification */
|
|
||||||
localStorage.removeItem(keyWaiting);
|
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
let refreshing = false;
|
let refreshing = false;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "jekyll-theme-chirpy"
|
spec.name = "jekyll-theme-chirpy"
|
||||||
spec.version = "5.2.0"
|
spec.version = "5.2.1"
|
||||||
spec.authors = ["Cotes Chung"]
|
spec.authors = ["Cotes Chung"]
|
||||||
spec.email = ["cotes.chung@gmail.com"]
|
spec.email = ["cotes.chung@gmail.com"]
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "jekyll-theme-chirpy",
|
"name": "jekyll-theme-chirpy",
|
||||||
"version": "5.2.0",
|
"version": "5.2.1",
|
||||||
"description": "A minimal, responsive, and powerful Jekyll theme for presenting professional writing.",
|
"description": "A minimal, responsive, and powerful Jekyll theme for presenting professional writing.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Reference in a new issue